码迷,mamicode.com
首页 > 其他好文 > 详细

[ES6] 21. ESNext, ES6-Shim & Node

时间:2015-04-29 07:06:55      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:

ES-Next:

Esnext is similar to traceur, you can use command line to compile files.

Install:

npm install esnext -g


Here‘s how to compile a single file an print it to stdout:

esnext myfile.js

 

To compile many files at once, specify an output directory:

esnext -o build lib/**/*.js

 

To enable source maps for these files, add the **--source-maps** flag.

But esnext doesn‘t support as many es6 features as traceur, so it is not that popular.


ES-shim

ES-shim is different from traceur and esnext. It is a list of shim and polyfills which you can include and use in the browser.
So it is really easy to use.

Install:

bower install es6-shim

 

Node

For Windows, need to install nodist for node manager.

 

 Usage:

node --harmony --use-strict app.js 

 

[ES6] 21. ESNext, ES6-Shim & Node

标签:

原文地址:http://www.cnblogs.com/Answer1215/p/4464553.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!