本文介绍了在Node.js中启用Harmony Proxies的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在nodejs中启用EcmaScript 6 Harmony Proxies?如果是这样,优缺点是什么?是否有任何有关如何使用它们的文档?谢谢!

Is it possible to enable EcmaScript 6 Harmony Proxies in nodejs? If so, what are the pros and cons? And is there any documentation on how to use them?Thanks !

推荐答案

使用node --harmony-proxies调用节点应该可以解决问题.

Invoking node with node --harmony-proxies should do the trick.

优点:当您确实需要代理时,代理是一项非常强大的功能.

Pros: proxies are a very powerful feature when you really need them.

缺点:当您不需要代理时(大多数情况下应该是代理),代理是一个功能太强大的功能.此外,该实现仍应视为实验性的.

Cons: proxies are a much too powerful feature when you don't need them (which should be most of the time). Also, the implementation should still be regarded experimental.

关于文档,真正存在的atm是Harmony Wiki,尤其是此页面,它反映了V8中代理的当前实现(因此是节点):

As for documentation, all there really is atm is the Harmony wiki, in particular this page, which reflects the current implementation of proxies in V8 (and thus node):

http://wiki.ecmascript.org/doku.php?id=和谐:代理人

这篇关于在Node.js中启用Harmony Proxies的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 08:28