JSPM

  • Created
  • Published
  • Downloads 44
  • Score
    100M100P100Q68371F
  • License SEE LICENSE IN LICENSE.txt

A functional style, but highly readable language that compiles to JavaScript.

Package Exports

  • futurescript/bin/fus

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (futurescript) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Please visit https://futurescript.org/ to learn the language.

Command Usage

npm install -g futurescript

The fus command works on Node.js 4.0 or higher. (We recommend Node.js 5.0 or higher.)

The generated JS, after "Babeled", works on any JS environment that supports ECMAScript 5th, including browser and Node.js old versions.

fus (compile | c) [--map] <file-or-directory> [<target-file-or-directory>]

fus (version | v | --version)

To compile, use compile or c.

At present, you may need Babel to downgrade the generated ES6 code to be compatible with your environment. For details, see Babel website.

In my opinion, Babel 5 is stable and easy to use. Babel 6 still has some bugs in some plug-ins. I recommend using Babel 5 if you want your generated JS to run on older Node.js or browser.

If you want your generated JS to run on Node.js 5.x or higher, you can use Babel 6 because you only need to enable these 3 Babel plugins which has no bugs (through my test):

  • transform-es2015-modules-commonjs
  • transform-es2015-destructuring
  • transform-es2015-parameters

--map will add the line numbers of the source to the generated code. Useful for debugging. (Note: this is not "source map", which is another technology.)

Because we use a very sophisticated versioning model that all historical compilers are kept, there's really no need to install it to your project directory - conflicts are very unlikely. But if you really "hate global", to avoid waste of disk space, it should be stated in "devDependencies", not "dependencies" (particularly when you're writing a middleware).

Examples

Compile "a.fus" to "a.js":

fus compile a.fus

Compile for debugging:

fus compile --map a.fus

Compile the whole "lib" directory to "target":

fus compile lib target

Develop this project

See "develop.md".

Changelog

See history.

License

See "LICENSE.txt".