Enables node's --harmony flag programmatically.
JavaScript
Latest commit 50ce59b Jul 10, 2015 @dcodeIO README
Failed to load latest commit information.
tests Don't die with bogus arguments, generators test Jul 10, 2015
.gitignore Support for io.js and node v0.12 Feb 13, 2015
LICENSE Initial release Apr 15, 2013
README.md README Jul 10, 2015
harmonize.js README Jul 10, 2015
package.json README Jul 10, 2015

README.md

node-harmonize

Enables node's --harmony flag programmatically.

Usage

npm install harmonize

require("harmonize")();
...
...
...

If your code uses syntax not supported by the host without the --harmony flag, simply put it in a different file and require(...) it:

require("harmonize")();
var other = require("./somethingUsingGenerators.js")
other();

Activating specific features only

If you intend to activate just a specific set of harmony features, you can provide these to harmonize:

require("harmonize")(["harmony-generators"]);
...
...
...

Please note that this might result in an error message being printed to console if the flag is not supported by your version of node.

License

Apache License, Version 2.0