Skip to content

Instantly share code, notes, and snippets.

@wtfil
Last active December 22, 2015 19:59
Show Gist options
  • Save wtfil/6523125 to your computer and use it in GitHub Desktop.
Save wtfil/6523125 to your computer and use it in GitHub Desktop.
ES6 generators with "suspend" module
var suspend = require('suspend'),
fs = require('fs');
suspend(function *(resume){
var users = yield fs.readdir('/Users', resume);
console.log(users);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment