The software team at Factual relies heavily on the outstanding work of the open source software community, and we’re always looking for opportunities to return the favor by donating our engineering time and effort.
JS2 is the first of hopefully many internal projects that we’re releasing as free, open source software. Our wish is that others will find JS2 either directly useful in their future projects, or indirectly helpful via idea exchange.
Some features include:
mixins (Ruby’s answer to multiple inheritance)
haml template assets
compiler can be run in a daemon mode so that it “watches” for changed files
There will now be 3 files in this directory: example.js2, example.js, js2bootstrap.js
Just include js2bootstrap.js and example.js (in that order) in the “head” section of your html file and it should run the code. Go ahead and peek inside example.js to see what the js2 code is converted to.