Skip to content

Instantly share code, notes, and snippets.

@bjouhier
Created May 9, 2013 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjouhier/5550288 to your computer and use it in GitHub Desktop.
Save bjouhier/5550288 to your computer and use it in GitHub Desktop.
streamlined harmony generators example based on https://gist.github.com/creationix/5544019
var fs = require('fs');
function testgen(_) {
console.log(fs.readFile(__filename, _));
console.log("Sleeping for 2000ms...");
setTimeout(_, 2000);
console.log("Done");
}
testgen(_);
@bjouhier
Copy link
Author

bjouhier commented May 9, 2013

To test it with generators, you must:

To see the generated generators code, run _node_harmony --generators -c testgen._js. This will generate a testgen.js file that you can run with node --harmony.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment