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 hidden or 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(_); |
Author
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._jsTo see the generated generators code, run
_node_harmony --generators -c testgen._js. This will generate atestgen.jsfile that you can run withnode --harmony.