Fetching contributors…
Cannot retrieve contributors at this time
109 lines (70 sloc) 3.32 KB

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,, 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
  • == and != operators
  • Variable shadowing

See this demo for a few more.

AST mode

The js2coffee compiler now produces a CoffeeScript AST (abstract syntax tree) before rendering your input into code. The command-line client features an --ast mode which lets you inspect the generated CoffeeScript AST.

Source maps

Source maps are now generated. More info on this soon.

Compatibility mode

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.

Improved API

The API has remained largely compatible with the 0.x series, but with improvements. The JavaScript API also reports the AST tree, source maps and warnings along with the output code. See the Migration guide for info on how the API has changed.

Tons of bugfixes

The 2.0 release closes a lot of bugs, including:

  • npm install js2coffee not working (#324)
  • Empty if statements fail (#265)
  • Variable scoping issues (#219)
  • and many more

Linking and sharing

You can show share your JavaScript and CoffeeScript snippets—perfect for collaborating with coworkers or answering at StackOverflow.

CoffeeScript preview pane

The new features an improved CoffeeScript to JavaScript compilation UI. This makes it easier to see how Js2coffee-generated CoffeeScript looks like compared to your original code.