Created
April 27, 2017 01:50
-
-
Save aearly/d1db52686dbfbcf58be34b2c0f49cae6 to your computer and use it in GitHub Desktop.
Async exaxmple 1
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
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