Es6 features and transpilers

ES6 is coming, but still a long way till all popular browsers full support it.

There are some ES6 to ES5 transpiler for now.

Default/Rest Parameters

Template String

Class

Arrow Function

Promise

Generators

let & const

for .. of

Modules

Map & Set

Babel

Babel formerly known as 6t05, is the most popular JavaScript compiler:

Install Babel is rather easy:

npm install -g babel

Then you can compile ES6 JavaScript to ES5 code:

babel es6-source.js –out-file es5-build.js

Traceur

Traceur is a JavaScript.next-to-JavaScript-of-today compiler.

It is rather simple to use Traceur in browser:


<!DOCTYPE html>

  
    

TypeScript

Microsoft’s JavaScript superset,support ES6. With command line tools, you could transpile .ts to .js file very easy.

Good IDE support with VS Code etc.

Coffiecript

Same as TypeScript

AtScript

Same as TypeScript,develop with Augular2.

dart2js

Dart to JS compiler.

Reference: