Enable Harmony Proxies in nodejs

Alexandre Kirszenberg picture Alexandre Kirszenberg · May 19, 2012 · Viewed 12.4k times · Source

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 !

Answer

Andreas Rossberg picture Andreas Rossberg · May 19, 2012

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.

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=harmony:proxies