Ecmascript 6 support on Node.js

后端 未结 3 1776
灰色年华
灰色年华 2021-02-07 21:22

I\'ve been working with KoaJS for a while, and we can easily use the \'let\' keyword and the generators when using the --harmony flag but I couldn\'t find how much support for

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-07 21:58

    With regards to your second question, yes, there is es6-module-loader. For a long list of transpilers, shims, and other tools for using full ES6 features now, see addyosmani's ECMAScript 6 Tools page.

    As for native ES6 support in node.js, V8 officially implements "ECMAScript" but AFAIK the V8 project doesn't release a spec of their implementation. However there are some sources of useful information out there. Here's a brief overview of ES6 in node.js v0.11.6.

    You may want to determine the version of V8 that your version of node.js uses. See the node.js blog for recent changelog info. It can also be useful to find the version of V8 used in a given Chromium release. The Chrome release notes can be found here. Keep in mind that different flags can be set for the same version of V8. Chromium and node.js both have ways to set flags in V8 related to ES6 support.

    Here are two tables that list ES(6) feature support across implementations:

    • http://pointedears.de/scripts/test/es-matrix/
    • http://kangax.github.io/compat-table/es6/

    This MDN page lists a set of reference articles for ES6 language features. At the bottom of each one you can see the status of Chrome support for that feature (and using V8 versions determine the support in node.js).

    Finally, the V8 issue tracker provides a list of issues related to ES6 features, many of which have been implemented and their issues closed.

提交回复
热议问题