Created
May 9, 2013 20:23
-
-
Save bjouhier/5550288 to your computer and use it in GitHub Desktop.
streamlined harmony generators example based on https://gist.github.com/creationix/5544019
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
function testgen(_) { | |
console.log(fs.readFile(__filename, _)); | |
console.log("Sleeping for 2000ms..."); | |
setTimeout(_, 2000); | |
console.log("Done"); | |
} | |
testgen(_); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To test it with generators, you must:
_node_harmony --generators testgen._js
To see the generated generators code, run
_node_harmony --generators -c testgen._js
. This will generate atestgen.js
file that you can run withnode --harmony
.