Node.js上的Ecmascript 6支持 [英] Ecmascript 6 support on Node.js

查看:180
本文介绍了Node.js上的Ecmascript 6支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经和KoaJS合作了一段时间,我们可以在使用--harmony标志时轻松使用'let'关键字和生成器,但我找不到节点v0.11的支持程度.x提供的同时使用相同的。

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 does the node v0.11.x provides while using the same.

我尝试使用默认值参数初始化但无法成功。

I tried using the default value argument initialization but couldn't succeed.

是否有任何可用的源可以使用和声标志列出节点v0.11.x中支持的ECS 6的功能?或者,如果有任何可用于节点的npm模块可以允许我使用它?

Is there any source available which can list the no of features of ECS 6 supported in node v0.11.x using the harmony flag? Or if there is any npm module available for node that might allow me to use the same?

提前致谢。

推荐答案

关于你的第二个问题,是的,有 ES6模块装载机
有关现在使用完整ES6功能的一长串转发器,垫片和其他工具,请参阅 addyosmani's ECMAScript 6工具页面

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.

对于node.js中的本机ES6支持,V8正式实现了ECMAScript,但是AFAIK V8项目没有发布他们的实现规范。
然而,有一些有用的信息来源。
这是 node.js v0.11.6中ES6的简要概述

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.

您可能希望确定您的node.js版本使用的V8版本
有关最近的更改日志信息,请参阅 node.js博客
它对查找给定Chromium版本中使用的V8版本
可以在此处找到Chrome发行说明。
请记住,可以为相同版本的V8设置不同的标志。
Chromium和node.js都有办法设置 V8中与ES6支持相关的标志

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.

这是两个表,列出了跨实现的ES(6)功能支持:

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/

此MDN页面列出了一组ES6语言功能的参考文章。
在每个版块的底部,您可以看到Chrome支持该功能的状态(并使用V8版本确定node.js中的支持)。

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).

最后, V8问题跟踪器
提供与ES6功能相关的问题列表,其中许多已经实现,他们的问题已经结束。

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

这篇关于Node.js上的Ecmascript 6支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆