DeCaffeinate Converts CoffeeScript To JavaScript

Image result for DeCaffeinate Converts CoffeeScript To JavaScriptImage result for DeCaffeinate Converts CoffeeScript To JavaScriptA new tool lets you automatically convert your CoffeeScript source to modern JavaScript. Decaffeinate is available now on GitHub.

CoffeeScript has been relatively successful because its code compiles one-to-one into JavaScript. Compiled output remains readable, passes through JavaScript Lint without warnings, will work in every JavaScript runtime. However, with JavaScript ES6 many of the things that CoffeeScript supplied are standard in JavaScript.

The advantage offered by ECMAScript 2015 (ES6) is that it defines the standard for the JavaScript implementation used in web browsers, is supported natively, and as it is an official standard it overcomes the need to rely on a project such as CoffeeScript that lacks such global definition and support.

CoffeeScript still has a lot of supporters, even taking ES6 into account. Developers praise its conciseness, and point out that CoffeeScript can compile to ES6 as a separate build step. Its supporters argue that CoffeeScript programs have fewer lines of code, and avoided contentious issues such as problems with undeclared vars, and JavaScript’s distinction between == and ===.

Those backing decaffeinate and ES6 say that despite such reservations, the momentum is with ES6. They credit many of ES6’s good points as having been derived from CoffeeScript. The strongest argument for conversion, and for using decaffeinate, is that as a redundant technology, CoffeeScript will eventually become defunct.

 

decaff

 

The decaffeinate project can be used to convert a single file or a whole project as a batch operation. The bulk conversion tool can check a codebase for decaffeinate-readiness, and once the code (or a part of it) is ready, will run the conversion and do some of the cleaning up necessary after the conversion.

There’s a fork of the CoffeeScript implementation with some small patches that are useful to the decaffeinate project.

 

coffeescript

 

Nodejs v6 Released

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, Facebook, Google+ or Linkedin.

[“Source-ndtv”]