Is there any way to get generators into node.js?
I\'m currently faking them with callbacks, but I have to remember to check the response of the callback inside of my gen
Yes and no.
var myGen = (function () { var i = 0; return function () { i++; return i; } })(); var i; while ((i = myGen()) < 100 ) { do something; }
As you see, you can implement something like one using closures, but it does not have native generators.