-
Notifications
You must be signed in to change notification settings - Fork 2
Command line interface
There are 3 main commands that can be run in js2:
Compile takes 2 arguments: source and destination. Source is the directory of the js2 and destination is the desired path for the outputted javascript. Add an optional "-r" to recursively traverse the source directory. Add an optional "-m=browser" (m for mode) to compile browser friendly javascript. Other modes include ringo and node. js2 compile -r -m=node src/ lib/
This behaves exactly like compile, but loops every few seconds to check up on changed files. You can control the time between loops by setting "-i=N" where N is the number of seconds. js2 watch -r -m=node src/ lib/
Render takes a js2 file and prints the equivalent javascript. It will also use the "-m" switch. js2 render -m=node foo.js2