What's new in 2.0
Js2coffee 2.0 is a complete rewrite of js2coffee v0.3 started in 2014. It was released February 1, 2015 and features a new parser, Esprima, replacing the aging Narcissus build that has been in use since 2011.
New web editor
The editor has been rebuilt and redesigned. It now features a new easy-to-use editor based on CodeMirror.
It also now lives in a new URL, js2.coffee, migrating away
from the old
Warnings and errors
Constructs that are not available in CoffeeScript are marked with errors, such as:
- Reassignment of global variables
- Variable shadowing
See this demo for a few more.
The js2coffee compiler now produces a CoffeeScript AST (abstract syntax tree) before
rendering your input into code. The command-line client features an
mode which lets you inspect the generated CoffeeScript AST.
Source maps are now generated. More info on this soon.
Js2coffee now features a compatibility mode (
--compat) to improve
reliability over generated CoffeeScript code (at the slight expense of elegance).
see the Compatibility mode documentation.
Try this demo — toggle the compatibility mode checkbox and see what happens.
Tons of bugfixes
The 2.0 release closes a lot of bugs, including:
npm install js2coffeenot working (#324)
- Empty if statements fail (#265)
- Variable scoping issues (#219)
- and many more
Linking and sharing
CoffeeScript preview pane