Jsjs
A handy javascript dialectic transpiler
Pull requests are very welcome!
Install
$ npm install [-g] jsjs
Features
- Not many, at the moment barelly recompiles sources.
Documentation
Usage
$ jsjs [options] <file> [...<files>]
Options
Options ### jsjs --tab [number of spaces] | -t [number of spaces]
Indents code with number of spaces
for each indentation level.
### jsjs --compress | -c
Removes optional whitespace between statements and declarations.
### jsjs --dialect [dialect] | -d [dialect]
Use another input dialect instead of javascript.
Javascript dialects are basically different languages which follow the style and the semantics of javascript.
This library includes the following dialects:
Standard Javascript (js): Common ECMAScript 5.
{ for var r = a n = 0; n < b; n++ r = r * a return r} { return arr;}
Go syntax without the type stuff.
Go-Script (gs): A clone offunc pow(a, b){ for r := a, n := 0; n < b; n++ { r = r * a } return r} func head(arr){ return arr[0:1]}
To register dialects as Node's require.extensions, you can use jsjs.register:
var jsjs = ; jsjs; // Go-Script registeredvar gos = ; jsjs; // registers all supported jsjs dialects