Skip to content

Instantly share code, notes, and snippets.

@aearly
Created April 27, 2017 01:50
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 aearly/d1db52686dbfbcf58be34b2c0f49cae6 to your computer and use it in GitHub Desktop.
Save aearly/d1db52686dbfbcf58be34b2c0f49cae6 to your computer and use it in GitHub Desktop.
Async exaxmple 1
async.eachLimit(files, 3, function (file, callback) {
fs.readFile(file, function(err, contents) {
if (err) return callback(err)
doSomethingWith(contents)
callback();
})
}, function (err) {
// hooray we're done
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment