{"_id":"async","_rev":"223-5df87f4f3d2584f561ccb40c7361a399","name":"async","description":"Higher-order functions and common patterns for asynchronous code","dist-tags":{"latest":"0.2.10"},"versions":{"0.1.0":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.0","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.0","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/async/-/async-0.1.0.tgz","shasum":"ab8ece0c40627e4e8f0e09c8fcf7c19ed0c4241c"},"directories":{}},"0.1.1":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.1","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.1","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/async/-/async-0.1.1.tgz","shasum":"fb965e70dbea44c8a4b8a948472dee7d27279d5e"},"directories":{}},"0.1.2":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.2","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.2","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/async/-/async-0.1.2.tgz","shasum":"be761882a64d3dc81a669f9ee3d5c28497382691"},"directories":{}},"0.1.3":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.3","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.3","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/async/-/async-0.1.3.tgz","shasum":"629ca2357112d90cafc33872366b14f2695a1fbc"},"directories":{}},"0.1.4":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.4","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.4","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/async/-/async-0.1.4.tgz","shasum":"29de4b98712ab8858411d8d8e3361a986c3b2c18"},"directories":{}},"0.1.5":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.5","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.5","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/async/-/async-0.1.5.tgz","shasum":"9d83e3d4adb9c962fc4a30e7dd04bf1206c28ea5"},"directories":{}},"0.1.6":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.6","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.6","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/async/-/async-0.1.6.tgz","shasum":"2dfb4fa1915f86056060c2e2f35a7fb8549907cc"},"directories":{}},"0.1.7":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.7","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.7","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.4-1","_nodeVersion":"v0.2.5","dist":{"tarball":"http://registry.npmjs.org/async/-/async-0.1.7.tgz","shasum":"e9268d0d8cd8dcfe0db0895b27dcc4bcc5c739a5"},"directories":{}},"0.1.8":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.8","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"web":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_id":"async@0.1.8","engines":{"node":"*"},"_nodeSupported":true,"dist":{"tarball":"http://registry.npmjs.org/async/-/async-0.1.8.tgz","shasum":"52f2df6c0aa6a7f8333e1fbac0fbd93670cf6758"},"directories":{}},"0.1.9":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.9","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"dependencies":{},"devDependencies":{},"_id":"async@0.1.9","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.1rc7","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"f984d0739b5382c949cc3bea702d21d0dbd52040","tarball":"http://registry.npmjs.org/async/-/async-0.1.9.tgz"},"directories":{}},"0.1.10":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.10","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/home/caolan/.npm/async/0.1.10/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"async@0.1.10","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"12b32bf098fa7fc51ae3ac51441b8ba15f437cf1","tarball":"http://registry.npmjs.org/async/-/async-0.1.10.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.11":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.11","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/home/caolan/.npm/async/0.1.11/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"async@0.1.11","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"a397a69c6febae232d20a76a5b10d8742e2b8215","tarball":"http://registry.npmjs.org/async/-/async-0.1.11.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.12":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.12","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_npmJsonOpts":{"file":"/home/caolan/.npm/async/0.1.12/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"async@0.1.12","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"ab36be6611dc63d91657128e1d65102b959d4afe","tarball":"http://registry.npmjs.org/async/-/async-0.1.12.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.13":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.13","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.13","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.101","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"f1e53ad69dab282d8e75cbec5e2c5524b6195eab","tarball":"http://registry.npmjs.org/async/-/async-0.1.13.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.14":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.14","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.14","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.101","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"0fcfaf089229fc657798203d1a4544102f7d26dc","tarball":"http://registry.npmjs.org/async/-/async-0.1.14.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.15":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.15","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.15","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.101","_nodeVersion":"v0.4.9","_defaultsLoaded":true,"dist":{"shasum":"2180eaca2cf2a6ca5280d41c0585bec9b3e49bd3","tarball":"http://registry.npmjs.org/async/-/async-0.1.15.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.16":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.16","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.16","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"b3a61fdc1a9193d4f64755c7600126e254223186","tarball":"http://registry.npmjs.org/async/-/async-0.1.16.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.17":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.17","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"dependencies":{"uglify-js":"1.2.x"},"devDependencies":{"nodeunit":">0.0.0","nodelint":">0.0.0"},"scripts":{"preinstall":"make clean","install":"make build","test":"make test"},"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.17","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"03524a379e974dc9ee5c811c6ee3815d7bc54f6e","tarball":"http://registry.npmjs.org/async/-/async-0.1.17.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.18":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.18","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.18","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"c59c923920b76d5bf23248c04433920c4d45086a","tarball":"http://registry.npmjs.org/async/-/async-0.1.18.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.19":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.19","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.19","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"4fd6125a70f841fb10b14aeec6e23cf1479c71a7","tarball":"http://registry.npmjs.org/async/-/async-0.1.19.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.20":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.20","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.20","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"ba0e47b08ae972e04b5215de28539b313482ede5","tarball":"http://registry.npmjs.org/async/-/async-0.1.20.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.21":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.21","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.21","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"b5b12e985f09ab72c202fa00f623cd9d997e9464","tarball":"http://registry.npmjs.org/async/-/async-0.1.21.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.1.22":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./index","author":{"name":"Caolan McMahon"},"version":"0.1.22","repository":{"type":"git","url":"git://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"_npmUser":{"name":"caolan","email":"caolan@caolanmcmahon.com"},"_id":"async@0.1.22","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.18","_defaultsLoaded":true,"dist":{"shasum":"0fc1aaa088a0e3ef0ebe2d8831bab0dcf8845061","tarball":"http://registry.npmjs.org/async/-/async-0.1.22.tgz"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.0":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.0","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"_id":"async@0.2.0","dist":{"shasum":"db1c645337bab79d0ca93d95f5c72d9605be0fce","tarball":"http://registry.npmjs.org/async/-/async-0.2.0.tgz"},"_npmVersion":"1.2.0","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.1":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.1","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"_id":"async@0.2.1","dist":{"shasum":"4e37d08391132f79657a99ca73aa4eb471a6f771","tarball":"http://registry.npmjs.org/async/-/async-0.2.1.tgz"},"_npmVersion":"1.2.0","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.2":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.2","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"_id":"async@0.2.2","dist":{"shasum":"8414ee47da7548126b4d3d923850d54e68a72b28","tarball":"http://registry.npmjs.org/async/-/async-0.2.2.tgz"},"_npmVersion":"1.2.0","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.3":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.3","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"_id":"async@0.2.3","dist":{"shasum":"79bf601d723a2e8c3e91cb6bb08f152dca309fb3","tarball":"http://registry.npmjs.org/async/-/async-0.2.3.tgz"},"_npmVersion":"1.2.0","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.4":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.4","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"_id":"async@0.2.4","dist":{"shasum":"0550e510cf43b83e2fcf1cb96399f03f1efd50eb","tarball":"http://registry.npmjs.org/async/-/async-0.2.4.tgz"},"_npmVersion":"1.2.0","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.5":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.5","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"_id":"async@0.2.5","dist":{"shasum":"45f05da480749ba4c1dcd8cd3a3747ae7b36fe52","tarball":"http://registry.npmjs.org/async/-/async-0.2.5.tgz"},"_npmVersion":"1.2.0","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.6":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.6","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"scripts":{"test":"nodeunit test/test-async.js"},"_id":"async@0.2.6","dist":{"shasum":"ad3f373d9249ae324881565582bc90e152abbd68","tarball":"http://registry.npmjs.org/async/-/async-0.2.6.tgz"},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.7":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.7","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"scripts":{"test":"nodeunit test/test-async.js"},"_id":"async@0.2.7","dist":{"shasum":"44c5ee151aece6c4bf5364cfc7c28fe4e58f18df","tarball":"http://registry.npmjs.org/async/-/async-0.2.7.tgz"},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.8":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.8","repository":{"type":"git","url":"http://github.com/caolan/async.git"},"bugs":{"url":"http://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"http://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"scripts":{"test":"nodeunit test/test-async.js"},"_id":"async@0.2.8","dist":{"shasum":"ba1b3ffd1e6cdb1e999aca76ef6ecee8e7f55f53","tarball":"http://registry.npmjs.org/async/-/async-0.2.8.tgz"},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.9":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.9","repository":{"type":"git","url":"https://github.com/caolan/async.git"},"bugs":{"url":"https://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"https://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"scripts":{"test":"nodeunit test/test-async.js"},"_id":"async@0.2.9","dist":{"shasum":"df63060fbf3d33286a76aaf6d55a2986d9ff8619","tarball":"http://registry.npmjs.org/async/-/async-0.2.9.tgz"},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}},"0.2.10":{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.10","repository":{"type":"git","url":"https://github.com/caolan/async.git"},"bugs":{"url":"https://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"https://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"scripts":{"test":"nodeunit test/test-async.js"},"_id":"async@0.2.10","dist":{"shasum":"b6bbe0b0674b9d719708ca38de8c237cb526c3d1","tarball":"http://registry.npmjs.org/async/-/async-0.2.10.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{}}},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"author":{"name":"Caolan McMahon"},"repository":{"type":"git","url":"https://github.com/caolan/async.git"},"time":{"modified":"2014-03-13T17:04:44.914Z","created":"2010-12-19T16:41:51.765Z","0.1.0":"2010-12-19T16:41:51.765Z","0.1.1":"2010-12-19T16:41:51.765Z","0.1.2":"2010-12-19T16:41:51.765Z","0.1.3":"2010-12-19T16:41:51.765Z","0.1.4":"2010-12-19T16:41:51.765Z","0.1.5":"2010-12-19T16:41:51.765Z","0.1.6":"2010-12-19T16:41:51.765Z","0.1.7":"2010-12-19T16:41:51.765Z","0.1.8":"2011-01-18T09:56:53.975Z","0.1.9":"2011-04-27T20:48:08.634Z","0.1.10":"2011-09-19T04:40:01.573Z","0.1.11":"2011-10-14T17:07:28.752Z","0.1.12":"2011-10-14T17:19:19.452Z","0.1.13":"2011-10-29T22:33:52.448Z","0.1.14":"2011-10-29T22:40:14.486Z","0.1.15":"2011-11-01T23:05:01.415Z","0.1.16":"2012-02-13T04:56:23.926Z","0.1.17":"2012-02-27T02:40:58.997Z","0.1.18":"2012-02-27T16:51:02.109Z","0.1.19":"2012-05-24T06:51:06.109Z","0.1.20":"2012-05-24T06:53:39.997Z","0.1.21":"2012-05-24T07:16:16.753Z","0.1.22":"2012-05-30T18:26:44.821Z","0.1.23":"2012-10-04T13:52:08.947Z","0.2.0":"2013-02-04T11:38:08.943Z","0.2.1":"2013-02-04T11:52:34.110Z","0.2.2":"2013-02-05T15:55:23.202Z","0.2.3":"2013-02-06T12:48:37.415Z","0.2.4":"2013-02-07T17:26:22.236Z","0.2.5":"2013-02-10T22:42:00.162Z","0.2.6":"2013-03-03T11:29:52.674Z","0.2.7":"2013-04-09T20:50:04.712Z","0.2.8":"2013-05-01T10:04:07.430Z","0.2.9":"2013-05-28T07:50:48.795Z","0.2.10":"2014-01-23T16:23:57.271Z"},"users":{"thejh":true,"avianflu":true,"dylang":true,"ragingwind":true,"mvolkmann":true,"mikl":true,"linus":true,"pvorb":true,"dodo":true,"danielr":true,"suor":true,"dolphin278":true,"kurijov":true,"langpavel":true,"alexindigo":true,"fgribreau":true,"hughsk":true,"pid":true,"tylerstalder":true,"gillesruppert":true,"coiscir":true,"xenomuta":true,"jgoodall":true,"jswartwood":true,"drudge":true,"cpsubrian":true,"joeferner":true,"bencevans":true,"Scryptonite":true,"damonoehlman":true,"glukki":true,"tivac":true,"shama":true,"gimenete":true,"bryanburgers":true,"hij1nx":true,"sandeepmistry":true,"minddiaper":true,"fiws":true,"ljharb":true,"popeindustries":true,"charmander":true,"dbrockman":true,"eknkc":true,"booyaa":true,"afc163":true,"maxmaximov":true,"meryn":true,"hfcorriez":true,"hyqhyq_3":true,"zonetti":true,"cmilhench":true,"cparker15":true,"jfromaniello":true,"ExxKA":true,"devoidfury":true,"cedrickchee":true,"niftymonkey":true,"paulj":true,"leesei":true,"jamesmgreene":true,"igorissen":true,"zaphod1984":true,"moonpyk":true,"joliva":true,"netroy":true,"chrisweb":true,"cuprobot":true,"tmaximini":true,"lupomontero":true,"john.pinch":true,"everywhere.js":true,"frankblizzard":true,"alanshaw":true,"forivall":true,"kubakubula":true,"doliveira":true,"dstokes":true,"pana":true,"irae":true,"mhaidarh":true,"feross":true,"tetsu3a":true,"qubyte":true,"darosh":true,"pragmadash":true,"denisix":true,"samuelrn":true,"tigefa":true,"tcrowe":true,"tpwk":true,"eins78":true,"sierrasoftworks":true,"yoavf":true,"irakli":true,"hypergeometric":true,"gammasoft":true,"youxiachai":true,"kahboom":true,"elisee":true,"soroush":true,"thomas-so":true,"shenaor":true,"dannynemer":true,"paulomcnally":true,"timur.shemsedinov":true,"slianfeng":true,"ettalea":true,"mananvaghasiya":true,"daniel7912":true,"themiddleman":true,"jacques":true,"kerimdzhanov":true,"jorgemsrs":true,"ivandimanov":true,"vegera":true,"aselzer":true,"kentcdodds":true,"putaoshu":true,"imdsm":true,"cilindrox":true},"readme":"# Async.js\u000a\u000aAsync is a utility module which provides straight-forward, powerful functions\u000afor working with asynchronous JavaScript. Although originally designed for\u000ause with [node.js](http://nodejs.org), it can also be used directly in the\u000abrowser. Also supports [component](https://github.com/component/component).\u000a\u000aAsync provides around 20 functions that include the usual 'functional'\u000asuspects (map, reduce, filter, each…) as well as some common patterns\u000afor asynchronous control flow (parallel, series, waterfall…). All these\u000afunctions assume you follow the node.js convention of providing a single\u000acallback as the last argument of your async function.\u000a\u000a\u000a## Quick Examples\u000a\u000a```javascript\u000aasync.map(['file1','file2','file3'], fs.stat, function(err, results){\u000a    // results is now an array of stats for each file\u000a});\u000a\u000aasync.filter(['file1','file2','file3'], fs.exists, function(results){\u000a    // results now equals an array of the existing files\u000a});\u000a\u000aasync.parallel([\u000a    function(){ ... },\u000a    function(){ ... }\u000a], callback);\u000a\u000aasync.series([\u000a    function(){ ... },\u000a    function(){ ... }\u000a]);\u000a```\u000a\u000aThere are many more functions available so take a look at the docs below for a\u000afull list. This module aims to be comprehensive, so if you feel anything is\u000amissing please create a GitHub issue for it.\u000a\u000a## Common Pitfalls\u000a\u000a### Binding a context to an iterator\u000a\u000aThis section is really about bind, not about async. If you are wondering how to\u000amake async execute your iterators in a given context, or are confused as to why\u000aa method of another library isn't working as an iterator, study this example:\u000a\u000a```js\u000a// Here is a simple object with an (unnecessarily roundabout) squaring method\u000avar AsyncSquaringLibrary = {\u000a  squareExponent: 2,\u000a  square: function(number, callback){ \u000a    var result = Math.pow(number, this.squareExponent);\u000a    setTimeout(function(){\u000a      callback(null, result);\u000a    }, 200);\u000a  }\u000a};\u000a\u000aasync.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){\u000a  // result is [NaN, NaN, NaN]\u000a  // This fails because the `this.squareExponent` expression in the square\u000a  // function is not evaluated in the context of AsyncSquaringLibrary, and is\u000a  // therefore undefined.\u000a});\u000a\u000aasync.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){\u000a  // result is [1, 4, 9]\u000a  // With the help of bind we can attach a context to the iterator before\u000a  // passing it to async. Now the square function will be executed in its \u000a  // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`\u000a  // will be as expected.\u000a});\u000a```\u000a\u000a## Download\u000a\u000aThe source is available for download from\u000a[GitHub](http://github.com/caolan/async).\u000aAlternatively, you can install using Node Package Manager (npm):\u000a\u000a    npm install async\u000a\u000a__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed\u000a\u000a## In the Browser\u000a\u000aSo far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:\u000a\u000a```html\u000a<script type=\"text/javascript\" src=\"async.js\"></script>\u000a<script type=\"text/javascript\">\u000a\u000a    async.map(data, asyncProcess, function(err, results){\u000a        alert(results);\u000a    });\u000a\u000a</script>\u000a```\u000a\u000a## Documentation\u000a\u000a### Collections\u000a\u000a* [each](#each)\u000a* [eachSeries](#eachSeries)\u000a* [eachLimit](#eachLimit)\u000a* [map](#map)\u000a* [mapSeries](#mapSeries)\u000a* [mapLimit](#mapLimit)\u000a* [filter](#filter)\u000a* [filterSeries](#filterSeries)\u000a* [reject](#reject)\u000a* [rejectSeries](#rejectSeries)\u000a* [reduce](#reduce)\u000a* [reduceRight](#reduceRight)\u000a* [detect](#detect)\u000a* [detectSeries](#detectSeries)\u000a* [sortBy](#sortBy)\u000a* [some](#some)\u000a* [every](#every)\u000a* [concat](#concat)\u000a* [concatSeries](#concatSeries)\u000a\u000a### Control Flow\u000a\u000a* [series](#series)\u000a* [parallel](#parallel)\u000a* [parallelLimit](#parallellimittasks-limit-callback)\u000a* [whilst](#whilst)\u000a* [doWhilst](#doWhilst)\u000a* [until](#until)\u000a* [doUntil](#doUntil)\u000a* [forever](#forever)\u000a* [waterfall](#waterfall)\u000a* [compose](#compose)\u000a* [applyEach](#applyEach)\u000a* [applyEachSeries](#applyEachSeries)\u000a* [queue](#queue)\u000a* [cargo](#cargo)\u000a* [auto](#auto)\u000a* [iterator](#iterator)\u000a* [apply](#apply)\u000a* [nextTick](#nextTick)\u000a* [times](#times)\u000a* [timesSeries](#timesSeries)\u000a\u000a### Utils\u000a\u000a* [memoize](#memoize)\u000a* [unmemoize](#unmemoize)\u000a* [log](#log)\u000a* [dir](#dir)\u000a* [noConflict](#noConflict)\u000a\u000a\u000a## Collections\u000a\u000a<a name=\"forEach\" />\u000a<a name=\"each\" />\u000a### each(arr, iterator, callback)\u000a\u000aApplies an iterator function to each item in an array, in parallel.\u000aThe iterator is called with an item from the list and a callback for when it\u000ahas finished. If the iterator passes an error to this callback, the main\u000acallback for the each function is immediately called with the error.\u000a\u000aNote, that since this function applies the iterator to each item in parallel\u000athere is no guarantee that the iterator functions will complete in order.\u000a\u000a__Arguments__\u000a\u000a* arr - An array to iterate over.\u000a* iterator(item, callback) - A function to apply to each item in the array.\u000a  The iterator is passed a callback(err) which must be called once it has \u000a  completed. If no error has occured, the callback should be run without \u000a  arguments or with an explicit null argument.\u000a* callback(err) - A callback which is called after all the iterator functions\u000a  have finished, or an error has occurred.\u000a\u000a__Example__\u000a\u000a```js\u000a// assuming openFiles is an array of file names and saveFile is a function\u000a// to save the modified contents of that file:\u000a\u000aasync.each(openFiles, saveFile, function(err){\u000a    // if any of the saves produced an error, err would equal that error\u000a});\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"forEachSeries\" />\u000a<a name=\"eachSeries\" />\u000a### eachSeries(arr, iterator, callback)\u000a\u000aThe same as each only the iterator is applied to each item in the array in\u000aseries. The next iterator is only called once the current one has completed\u000aprocessing. This means the iterator functions will complete in order.\u000a\u000a\u000a---------------------------------------\u000a\u000a<a name=\"forEachLimit\" />\u000a<a name=\"eachLimit\" />\u000a### eachLimit(arr, limit, iterator, callback)\u000a\u000aThe same as each only no more than \"limit\" iterators will be simultaneously \u000arunning at any time.\u000a\u000aNote that the items are not processed in batches, so there is no guarantee that\u000a the first \"limit\" iterator functions will complete before any others are \u000astarted.\u000a\u000a__Arguments__\u000a\u000a* arr - An array to iterate over.\u000a* limit - The maximum number of iterators to run at any time.\u000a* iterator(item, callback) - A function to apply to each item in the array.\u000a  The iterator is passed a callback(err) which must be called once it has \u000a  completed. If no error has occured, the callback should be run without \u000a  arguments or with an explicit null argument.\u000a* callback(err) - A callback which is called after all the iterator functions\u000a  have finished, or an error has occurred.\u000a\u000a__Example__\u000a\u000a```js\u000a// Assume documents is an array of JSON objects and requestApi is a\u000a// function that interacts with a rate-limited REST api.\u000a\u000aasync.eachLimit(documents, 20, requestApi, function(err){\u000a    // if any of the saves produced an error, err would equal that error\u000a});\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"map\" />\u000a### map(arr, iterator, callback)\u000a\u000aProduces a new array of values by mapping each value in the given array through\u000athe iterator function. The iterator is called with an item from the array and a\u000acallback for when it has finished processing. The callback takes 2 arguments, \u000aan error and the transformed item from the array. If the iterator passes an\u000aerror to this callback, the main callback for the map function is immediately\u000acalled with the error.\u000a\u000aNote, that since this function applies the iterator to each item in parallel\u000athere is no guarantee that the iterator functions will complete in order, however\u000athe results array will be in the same order as the original array.\u000a\u000a__Arguments__\u000a\u000a* arr - An array to iterate over.\u000a* iterator(item, callback) - A function to apply to each item in the array.\u000a  The iterator is passed a callback(err, transformed) which must be called once \u000a  it has completed with an error (which can be null) and a transformed item.\u000a* callback(err, results) - A callback which is called after all the iterator\u000a  functions have finished, or an error has occurred. Results is an array of the\u000a  transformed items from the original array.\u000a\u000a__Example__\u000a\u000a```js\u000aasync.map(['file1','file2','file3'], fs.stat, function(err, results){\u000a    // results is now an array of stats for each file\u000a});\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"mapSeries\" />\u000a### mapSeries(arr, iterator, callback)\u000a\u000aThe same as map only the iterator is applied to each item in the array in\u000aseries. The next iterator is only called once the current one has completed\u000aprocessing. The results array will be in the same order as the original.\u000a\u000a\u000a---------------------------------------\u000a\u000a<a name=\"mapLimit\" />\u000a### mapLimit(arr, limit, iterator, callback)\u000a\u000aThe same as map only no more than \"limit\" iterators will be simultaneously \u000arunning at any time.\u000a\u000aNote that the items are not processed in batches, so there is no guarantee that\u000a the first \"limit\" iterator functions will complete before any others are \u000astarted.\u000a\u000a__Arguments__\u000a\u000a* arr - An array to iterate over.\u000a* limit - The maximum number of iterators to run at any time.\u000a* iterator(item, callback) - A function to apply to each item in the array.\u000a  The iterator is passed a callback(err, transformed) which must be called once \u000a  it has completed with an error (which can be null) and a transformed item.\u000a* callback(err, results) - A callback which is called after all the iterator\u000a  functions have finished, or an error has occurred. Results is an array of the\u000a  transformed items from the original array.\u000a\u000a__Example__\u000a\u000a```js\u000aasync.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){\u000a    // results is now an array of stats for each file\u000a});\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"filter\" />\u000a### filter(arr, iterator, callback)\u000a\u000a__Alias:__ select\u000a\u000aReturns a new array of all the values which pass an async truth test.\u000a_The callback for each iterator call only accepts a single argument of true or\u000afalse, it does not accept an error argument first!_ This is in-line with the\u000away node libraries work with truth tests like fs.exists. This operation is\u000aperformed in parallel, but the results array will be in the same order as the\u000aoriginal.\u000a\u000a__Arguments__\u000a\u000a* arr - An array to iterate over.\u000a* iterator(item, callback) - A truth test to apply to each item in the array.\u000a  The iterator is passed a callback(truthValue) which must be called with a \u000a  boolean argument once it has completed.\u000a* callback(results) - A callback which is called after all the iterator\u000a  functions have finished.\u000a\u000a__Example__\u000a\u000a```js\u000aasync.filter(['file1','file2','file3'], fs.exists, function(results){\u000a    // results now equals an array of the existing files\u000a});\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"filterSeries\" />\u000a### filterSeries(arr, iterator, callback)\u000a\u000a__alias:__ selectSeries\u000a\u000aThe same as filter only the iterator is applied to each item in the array in\u000aseries. The next iterator is only called once the current one has completed\u000aprocessing. The results array will be in the same order as the original.\u000a\u000a---------------------------------------\u000a\u000a<a name=\"reject\" />\u000a### reject(arr, iterator, callback)\u000a\u000aThe opposite of filter. Removes values that pass an async truth test.\u000a\u000a---------------------------------------\u000a\u000a<a name=\"rejectSeries\" />\u000a### rejectSeries(arr, iterator, callback)\u000a\u000aThe same as reject, only the iterator is applied to each item in the array\u000ain series.\u000a\u000a\u000a---------------------------------------\u000a\u000a<a name=\"reduce\" />\u000a### reduce(arr, memo, iterator, callback)\u000a\u000a__aliases:__ inject, foldl\u000a\u000aReduces a list of values into a single value using an async iterator to return\u000aeach successive step. Memo is the initial state of the reduction. This\u000afunction only operates in series. For performance reasons, it may make sense to\u000asplit a call to this function into a parallel map, then use the normal\u000aArray.prototype.reduce on the results. This function is for situations where\u000aeach step in the reduction needs to be async, if you can get the data before\u000areducing it then it's probably a good idea to do so.\u000a\u000a__Arguments__\u000a\u000a* arr - An array to iterate over.\u000a* memo - The initial state of the reduction.\u000a* iterator(memo, item, callback) - A function applied to each item in the\u000a  array to produce the next step in the reduction. The iterator is passed a\u000a  callback(err, reduction) which accepts an optional error as its first \u000a  argument, and the state of the reduction as the second. If an error is \u000a  passed to the callback, the reduction is stopped and the main callback is \u000a  immediately called with the error.\u000a* callback(err, result) - A callback which is called after all the iterator\u000a  functions have finished. Result is the reduced value.\u000a\u000a__Example__\u000a\u000a```js\u000aasync.reduce([1,2,3], 0, function(memo, item, callback){\u000a    // pointless async:\u000a    process.nextTick(function(){\u000a        callback(null, memo + item)\u000a    });\u000a}, function(err, result){\u000a    // result is now equal to the last value of memo, which is 6\u000a});\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"reduceRight\" />\u000a### reduceRight(arr, memo, iterator, callback)\u000a\u000a__Alias:__ foldr\u000a\u000aSame as reduce, only operates on the items in the array in reverse order.\u000a\u000a\u000a---------------------------------------\u000a\u000a<a name=\"detect\" />\u000a### detect(arr, iterator, callback)\u000a\u000aReturns the first value in a list that passes an async truth test. The\u000aiterator is applied in parallel, meaning the first iterator to return true will\u000afire the detect callback with that result. That means the result might not be\u000athe first item in the original array (in terms of order) that passes the test.\u000a\u000aIf order within the original array is important then look at detectSeries.\u000a\u000a__Arguments__\u000a\u000a* arr - An array to iterate over.\u000a* iterator(item, callback) - A truth test to apply to each item in the array.\u000a  The iterator is passed a callback(truthValue) which must be called with a \u000a  boolean argument once it has completed.\u000a* callback(result) - A callback which is called as soon as any iterator returns\u000a  true, or after all the iterator functions have finished. Result will be\u000a  the first item in the array that passes the truth test (iterator) or the\u000a  value undefined if none passed.\u000a\u000a__Example__\u000a\u000a```js\u000aasync.detect(['file1','file2','file3'], fs.exists, function(result){\u000a    // result now equals the first file in the list that exists\u000a});\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"detectSeries\" />\u000a### detectSeries(arr, iterator, callback)\u000a\u000aThe same as detect, only the iterator is applied to each item in the array\u000ain series. This means the result is always the first in the original array (in\u000aterms of array order) that passes the truth test.\u000a\u000a\u000a---------------------------------------\u000a\u000a<a name=\"sortBy\" />\u000a### sortBy(arr, iterator, callback)\u000a\u000aSorts a list by the results of running each value through an async iterator.\u000a\u000a__Arguments__\u000a\u000a* arr - An array to iterate over.\u000a* iterator(item, callback) - A function to apply to each item in the array.\u000a  The iterator is passed a callback(err, sortValue) which must be called once it\u000a  has completed with an error (which can be null) and a value to use as the sort\u000a  criteria.\u000a* callback(err, results) - A callback which is called after all the iterator\u000a  functions have finished, or an error has occurred. Results is the items from\u000a  the original array sorted by the values returned by the iterator calls.\u000a\u000a__Example__\u000a\u000a```js\u000aasync.sortBy(['file1','file2','file3'], function(file, callback){\u000a    fs.stat(file, function(err, stats){\u000a        callback(err, stats.mtime);\u000a    });\u000a}, function(err, results){\u000a    // results is now the original array of files sorted by\u000a    // modified date\u000a});\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"some\" />\u000a### some(arr, iterator, callback)\u000a\u000a__Alias:__ any\u000a\u000aReturns true if at least one element in the array satisfies an async test.\u000a_The callback for each iterator call only accepts a single argument of true or\u000afalse, it does not accept an error argument first!_ This is in-line with the\u000away node libraries work with truth tests like fs.exists. Once any iterator\u000acall returns true, the main callback is immediately called.\u000a\u000a__Arguments__\u000a\u000a* arr - An array to iterate over.\u000a* iterator(item, callback) - A truth test to apply to each item in the array.\u000a  The iterator is passed a callback(truthValue) which must be called with a \u000a  boolean argument once it has completed.\u000a* callback(result) - A callback which is called as soon as any iterator returns\u000a  true, or after all the iterator functions have finished. Result will be\u000a  either true or false depending on the values of the async tests.\u000a\u000a__Example__\u000a\u000a```js\u000aasync.some(['file1','file2','file3'], fs.exists, function(result){\u000a    // if result is true then at least one of the files exists\u000a});\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"every\" />\u000a### every(arr, iterator, callback)\u000a\u000a__Alias:__ all\u000a\u000aReturns true if every element in the array satisfies an async test.\u000a_The callback for each iterator call only accepts a single argument of true or\u000afalse, it does not accept an error argument first!_ This is in-line with the\u000away node libraries work with truth tests like fs.exists.\u000a\u000a__Arguments__\u000a\u000a* arr - An array to iterate over.\u000a* iterator(item, callback) - A truth test to apply to each item in the array.\u000a  The iterator is passed a callback(truthValue) which must be called with a \u000a  boolean argument once it has completed.\u000a* callback(result) - A callback which is called after all the iterator\u000a  functions have finished. Result will be either true or false depending on\u000a  the values of the async tests.\u000a\u000a__Example__\u000a\u000a```js\u000aasync.every(['file1','file2','file3'], fs.exists, function(result){\u000a    // if result is true then every file exists\u000a});\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"concat\" />\u000a### concat(arr, iterator, callback)\u000a\u000aApplies an iterator to each item in a list, concatenating the results. Returns the\u000aconcatenated list. The iterators are called in parallel, and the results are\u000aconcatenated as they return. There is no guarantee that the results array will\u000abe returned in the original order of the arguments passed to the iterator function.\u000a\u000a__Arguments__\u000a\u000a* arr - An array to iterate over\u000a* iterator(item, callback) - A function to apply to each item in the array.\u000a  The iterator is passed a callback(err, results) which must be called once it \u000a  has completed with an error (which can be null) and an array of results.\u000a* callback(err, results) - A callback which is called after all the iterator\u000a  functions have finished, or an error has occurred. Results is an array containing\u000a  the concatenated results of the iterator function.\u000a\u000a__Example__\u000a\u000a```js\u000aasync.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\u000a    // files is now a list of filenames that exist in the 3 directories\u000a});\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"concatSeries\" />\u000a### concatSeries(arr, iterator, callback)\u000a\u000aSame as async.concat, but executes in series instead of parallel.\u000a\u000a\u000a## Control Flow\u000a\u000a<a name=\"series\" />\u000a### series(tasks, [callback])\u000a\u000aRun an array of functions in series, each one running once the previous\u000afunction has completed. If any functions in the series pass an error to its\u000acallback, no more functions are run and the callback for the series is\u000aimmediately called with the value of the error. Once the tasks have completed,\u000athe results are passed to the final callback as an array.\u000a\u000aIt is also possible to use an object instead of an array. Each property will be\u000arun as a function and the results will be passed to the final callback as an object\u000ainstead of an array. This can be a more readable way of handling results from\u000aasync.series.\u000a\u000a\u000a__Arguments__\u000a\u000a* tasks - An array or object containing functions to run, each function is passed\u000a  a callback(err, result) it must call on completion with an error (which can\u000a  be null) and an optional result value.\u000a* callback(err, results) - An optional callback to run once all the functions\u000a  have completed. This function gets a results array (or object) containing all \u000a  the result arguments passed to the task callbacks.\u000a\u000a__Example__\u000a\u000a```js\u000aasync.series([\u000a    function(callback){\u000a        // do some stuff ...\u000a        callback(null, 'one');\u000a    },\u000a    function(callback){\u000a        // do some more stuff ...\u000a        callback(null, 'two');\u000a    }\u000a],\u000a// optional callback\u000afunction(err, results){\u000a    // results is now equal to ['one', 'two']\u000a});\u000a\u000a\u000a// an example using an object instead of an array\u000aasync.series({\u000a    one: function(callback){\u000a        setTimeout(function(){\u000a            callback(null, 1);\u000a        }, 200);\u000a    },\u000a    two: function(callback){\u000a        setTimeout(function(){\u000a            callback(null, 2);\u000a        }, 100);\u000a    }\u000a},\u000afunction(err, results) {\u000a    // results is now equal to: {one: 1, two: 2}\u000a});\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"parallel\" />\u000a### parallel(tasks, [callback])\u000a\u000aRun an array of functions in parallel, without waiting until the previous\u000afunction has completed. If any of the functions pass an error to its\u000acallback, the main callback is immediately called with the value of the error.\u000aOnce the tasks have completed, the results are passed to the final callback as an\u000aarray.\u000a\u000aIt is also possible to use an object instead of an array. Each property will be\u000arun as a function and the results will be passed to the final callback as an object\u000ainstead of an array. This can be a more readable way of handling results from\u000aasync.parallel.\u000a\u000a\u000a__Arguments__\u000a\u000a* tasks - An array or object containing functions to run, each function is passed \u000a  a callback(err, result) it must call on completion with an error (which can\u000a  be null) and an optional result value.\u000a* callback(err, results) - An optional callback to run once all the functions\u000a  have completed. This function gets a results array (or object) containing all \u000a  the result arguments passed to the task callbacks.\u000a\u000a__Example__\u000a\u000a```js\u000aasync.parallel([\u000a    function(callback){\u000a        setTimeout(function(){\u000a            callback(null, 'one');\u000a        }, 200);\u000a    },\u000a    function(callback){\u000a        setTimeout(function(){\u000a            callback(null, 'two');\u000a        }, 100);\u000a    }\u000a],\u000a// optional callback\u000afunction(err, results){\u000a    // the results array will equal ['one','two'] even though\u000a    // the second function had a shorter timeout.\u000a});\u000a\u000a\u000a// an example using an object instead of an array\u000aasync.parallel({\u000a    one: function(callback){\u000a        setTimeout(function(){\u000a            callback(null, 1);\u000a        }, 200);\u000a    },\u000a    two: function(callback){\u000a        setTimeout(function(){\u000a            callback(null, 2);\u000a        }, 100);\u000a    }\u000a},\u000afunction(err, results) {\u000a    // results is now equals to: {one: 1, two: 2}\u000a});\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"parallel\" />\u000a### parallelLimit(tasks, limit, [callback])\u000a\u000aThe same as parallel only the tasks are executed in parallel with a maximum of \"limit\" \u000atasks executing at any time.\u000a\u000aNote that the tasks are not executed in batches, so there is no guarantee that \u000athe first \"limit\" tasks will complete before any others are started.\u000a\u000a__Arguments__\u000a\u000a* tasks - An array or object containing functions to run, each function is passed \u000a  a callback(err, result) it must call on completion with an error (which can\u000a  be null) and an optional result value.\u000a* limit - The maximum number of tasks to run at any time.\u000a* callback(err, results) - An optional callback to run once all the functions\u000a  have completed. This function gets a results array (or object) containing all \u000a  the result arguments passed to the task callbacks.\u000a\u000a---------------------------------------\u000a\u000a<a name=\"whilst\" />\u000a### whilst(test, fn, callback)\u000a\u000aRepeatedly call fn, while test returns true. Calls the callback when stopped,\u000aor an error occurs.\u000a\u000a__Arguments__\u000a\u000a* test() - synchronous truth test to perform before each execution of fn.\u000a* fn(callback) - A function to call each time the test passes. The function is\u000a  passed a callback(err) which must be called once it has completed with an \u000a  optional error argument.\u000a* callback(err) - A callback which is called after the test fails and repeated\u000a  execution of fn has stopped.\u000a\u000a__Example__\u000a\u000a```js\u000avar count = 0;\u000a\u000aasync.whilst(\u000a    function () { return count < 5; },\u000a    function (callback) {\u000a        count++;\u000a        setTimeout(callback, 1000);\u000a    },\u000a    function (err) {\u000a        // 5 seconds have passed\u000a    }\u000a);\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"doWhilst\" />\u000a### doWhilst(fn, test, callback)\u000a\u000aThe post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\u000a\u000a---------------------------------------\u000a\u000a<a name=\"until\" />\u000a### until(test, fn, callback)\u000a\u000aRepeatedly call fn, until test returns true. Calls the callback when stopped,\u000aor an error occurs.\u000a\u000aThe inverse of async.whilst.\u000a\u000a---------------------------------------\u000a\u000a<a name=\"doUntil\" />\u000a### doUntil(fn, test, callback)\u000a\u000aLike doWhilst except the test is inverted. Note the argument ordering differs from `until`.\u000a\u000a---------------------------------------\u000a\u000a<a name=\"forever\" />\u000a### forever(fn, callback)\u000a\u000aCalls the asynchronous function 'fn' repeatedly, in series, indefinitely.\u000aIf an error is passed to fn's callback then 'callback' is called with the\u000aerror, otherwise it will never be called.\u000a\u000a---------------------------------------\u000a\u000a<a name=\"waterfall\" />\u000a### waterfall(tasks, [callback])\u000a\u000aRuns an array of functions in series, each passing their results to the next in\u000athe array. However, if any of the functions pass an error to the callback, the\u000anext function is not executed and the main callback is immediately called with\u000athe error.\u000a\u000a__Arguments__\u000a\u000a* tasks - An array of functions to run, each function is passed a \u000a  callback(err, result1, result2, ...) it must call on completion. The first\u000a  argument is an error (which can be null) and any further arguments will be \u000a  passed as arguments in order to the next task.\u000a* callback(err, [results]) - An optional callback to run once all the functions\u000a  have completed. This will be passed the results of the last task's callback.\u000a\u000a\u000a\u000a__Example__\u000a\u000a```js\u000aasync.waterfall([\u000a    function(callback){\u000a        callback(null, 'one', 'two');\u000a    },\u000a    function(arg1, arg2, callback){\u000a        callback(null, 'three');\u000a    },\u000a    function(arg1, callback){\u000a        // arg1 now equals 'three'\u000a        callback(null, 'done');\u000a    }\u000a], function (err, result) {\u000a   // result now equals 'done'    \u000a});\u000a```\u000a\u000a---------------------------------------\u000a<a name=\"compose\" />\u000a### compose(fn1, fn2...)\u000a\u000aCreates a function which is a composition of the passed asynchronous\u000afunctions. Each function consumes the return value of the function that\u000afollows. Composing functions f(), g() and h() would produce the result of\u000af(g(h())), only this version uses callbacks to obtain the return values.\u000a\u000aEach function is executed with the `this` binding of the composed function.\u000a\u000a__Arguments__\u000a\u000a* functions... - the asynchronous functions to compose\u000a\u000a\u000a__Example__\u000a\u000a```js\u000afunction add1(n, callback) {\u000a    setTimeout(function () {\u000a        callback(null, n + 1);\u000a    }, 10);\u000a}\u000a\u000afunction mul3(n, callback) {\u000a    setTimeout(function () {\u000a        callback(null, n * 3);\u000a    }, 10);\u000a}\u000a\u000avar add1mul3 = async.compose(mul3, add1);\u000a\u000aadd1mul3(4, function (err, result) {\u000a   // result now equals 15\u000a});\u000a```\u000a\u000a---------------------------------------\u000a<a name=\"applyEach\" />\u000a### applyEach(fns, args..., callback)\u000a\u000aApplies the provided arguments to each function in the array, calling the\u000acallback after all functions have completed. If you only provide the first\u000aargument then it will return a function which lets you pass in the\u000aarguments as if it were a single function call.\u000a\u000a__Arguments__\u000a\u000a* fns - the asynchronous functions to all call with the same arguments\u000a* args... - any number of separate arguments to pass to the function\u000a* callback - the final argument should be the callback, called when all\u000a  functions have completed processing\u000a\u000a\u000a__Example__\u000a\u000a```js\u000aasync.applyEach([enableSearch, updateSchema], 'bucket', callback);\u000a\u000a// partial application example:\u000aasync.each(\u000a    buckets,\u000a    async.applyEach([enableSearch, updateSchema]),\u000a    callback\u000a);\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"applyEachSeries\" />\u000a### applyEachSeries(arr, iterator, callback)\u000a\u000aThe same as applyEach only the functions are applied in series.\u000a\u000a---------------------------------------\u000a\u000a<a name=\"queue\" />\u000a### queue(worker, concurrency)\u000a\u000aCreates a queue object with the specified concurrency. Tasks added to the\u000aqueue will be processed in parallel (up to the concurrency limit). If all\u000aworkers are in progress, the task is queued until one is available. Once\u000aa worker has completed a task, the task's callback is called.\u000a\u000a__Arguments__\u000a\u000a* worker(task, callback) - An asynchronous function for processing a queued\u000a  task, which must call its callback(err) argument when finished, with an \u000a  optional error as an argument.\u000a* concurrency - An integer for determining how many worker functions should be\u000a  run in parallel.\u000a\u000a__Queue objects__\u000a\u000aThe queue object returned by this function has the following properties and\u000amethods:\u000a\u000a* length() - a function returning the number of items waiting to be processed.\u000a* concurrency - an integer for determining how many worker functions should be\u000a  run in parallel. This property can be changed after a queue is created to\u000a  alter the concurrency on-the-fly.\u000a* push(task, [callback]) - add a new task to the queue, the callback is called\u000a  once the worker has finished processing the task.\u000a  instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\u000a* unshift(task, [callback]) - add a new task to the front of the queue.\u000a* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\u000a* empty - a callback that is called when the last item from the queue is given to a worker\u000a* drain - a callback that is called when the last item from the queue has returned from the worker\u000a\u000a__Example__\u000a\u000a```js\u000a// create a queue object with concurrency 2\u000a\u000avar q = async.queue(function (task, callback) {\u000a    console.log('hello ' + task.name);\u000a    callback();\u000a}, 2);\u000a\u000a\u000a// assign a callback\u000aq.drain = function() {\u000a    console.log('all items have been processed');\u000a}\u000a\u000a// add some items to the queue\u000a\u000aq.push({name: 'foo'}, function (err) {\u000a    console.log('finished processing foo');\u000a});\u000aq.push({name: 'bar'}, function (err) {\u000a    console.log('finished processing bar');\u000a});\u000a\u000a// add some items to the queue (batch-wise)\u000a\u000aq.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\u000a    console.log('finished processing bar');\u000a});\u000a\u000a// add some items to the front of the queue\u000a\u000aq.unshift({name: 'bar'}, function (err) {\u000a    console.log('finished processing bar');\u000a});\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"cargo\" />\u000a### cargo(worker, [payload])\u000a\u000aCreates a cargo object with the specified payload. Tasks added to the\u000acargo will be processed altogether (up to the payload limit). If the\u000aworker is in progress, the task is queued until it is available. Once\u000athe worker has completed some tasks, each callback of those tasks is called.\u000a\u000a__Arguments__\u000a\u000a* worker(tasks, callback) - An asynchronous function for processing an array of\u000a  queued tasks, which must call its callback(err) argument when finished, with \u000a  an optional error as an argument.\u000a* payload - An optional integer for determining how many tasks should be\u000a  processed per round; if omitted, the default is unlimited.\u000a\u000a__Cargo objects__\u000a\u000aThe cargo object returned by this function has the following properties and\u000amethods:\u000a\u000a* length() - a function returning the number of items waiting to be processed.\u000a* payload - an integer for determining how many tasks should be\u000a  process per round. This property can be changed after a cargo is created to\u000a  alter the payload on-the-fly.\u000a* push(task, [callback]) - add a new task to the queue, the callback is called\u000a  once the worker has finished processing the task.\u000a  instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\u000a* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\u000a* empty - a callback that is called when the last item from the queue is given to a worker\u000a* drain - a callback that is called when the last item from the queue has returned from the worker\u000a\u000a__Example__\u000a\u000a```js\u000a// create a cargo object with payload 2\u000a\u000avar cargo = async.cargo(function (tasks, callback) {\u000a    for(var i=0; i<tasks.length; i++){\u000a      console.log('hello ' + tasks[i].name);\u000a    }\u000a    callback();\u000a}, 2);\u000a\u000a\u000a// add some items\u000a\u000acargo.push({name: 'foo'}, function (err) {\u000a    console.log('finished processing foo');\u000a});\u000acargo.push({name: 'bar'}, function (err) {\u000a    console.log('finished processing bar');\u000a});\u000acargo.push({name: 'baz'}, function (err) {\u000a    console.log('finished processing baz');\u000a});\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"auto\" />\u000a### auto(tasks, [callback])\u000a\u000aDetermines the best order for running functions based on their requirements.\u000aEach function can optionally depend on other functions being completed first,\u000aand each function is run as soon as its requirements are satisfied. If any of\u000athe functions pass an error to their callback, that function will not complete\u000a(so any other functions depending on it will not run) and the main callback\u000awill be called immediately with the error. Functions also receive an object\u000acontaining the results of functions which have completed so far.\u000a\u000aNote, all functions are called with a results object as a second argument, \u000aso it is unsafe to pass functions in the tasks object which cannot handle the\u000aextra argument. For example, this snippet of code:\u000a\u000a```js\u000aasync.auto({\u000a  readData: async.apply(fs.readFile, 'data.txt', 'utf-8')\u000a}, callback);\u000a```\u000a\u000awill have the effect of calling readFile with the results object as the last\u000aargument, which will fail:\u000a\u000a```js\u000afs.readFile('data.txt', 'utf-8', cb, {});\u000a```\u000a\u000aInstead, wrap the call to readFile in a function which does not forward the \u000aresults object:\u000a\u000a```js\u000aasync.auto({\u000a  readData: function(cb, results){\u000a    fs.readFile('data.txt', 'utf-8', cb);\u000a  }\u000a}, callback);\u000a```\u000a\u000a__Arguments__\u000a\u000a* tasks - An object literal containing named functions or an array of\u000a  requirements, with the function itself the last item in the array. The key\u000a  used for each function or array is used when specifying requirements. The \u000a  function receives two arguments: (1) a callback(err, result) which must be \u000a  called when finished, passing an error (which can be null) and the result of \u000a  the function's execution, and (2) a results object, containing the results of\u000a  the previously executed functions.\u000a* callback(err, results) - An optional callback which is called when all the\u000a  tasks have been completed. The callback will receive an error as an argument\u000a  if any tasks pass an error to their callback. Results will always be passed\u000a\u0009but if an error occurred, no other tasks will be performed, and the results\u000a\u0009object will only contain partial results.\u000a  \u000a\u000a__Example__\u000a\u000a```js\u000aasync.auto({\u000a    get_data: function(callback){\u000a        // async code to get some data\u000a    },\u000a    make_folder: function(callback){\u000a        // async code to create a directory to store a file in\u000a        // this is run at the same time as getting the data\u000a    },\u000a    write_file: ['get_data', 'make_folder', function(callback){\u000a        // once there is some data and the directory exists,\u000a        // write the data to a file in the directory\u000a        callback(null, filename);\u000a    }],\u000a    email_link: ['write_file', function(callback, results){\u000a        // once the file is written let's email a link to it...\u000a        // results.write_file contains the filename returned by write_file.\u000a    }]\u000a});\u000a```\u000a\u000aThis is a fairly trivial example, but to do this using the basic parallel and\u000aseries functions would look like this:\u000a\u000a```js\u000aasync.parallel([\u000a    function(callback){\u000a        // async code to get some data\u000a    },\u000a    function(callback){\u000a        // async code to create a directory to store a file in\u000a        // this is run at the same time as getting the data\u000a    }\u000a],\u000afunction(err, results){\u000a    async.series([\u000a        function(callback){\u000a            // once there is some data and the directory exists,\u000a            // write the data to a file in the directory\u000a        },\u000a        function(callback){\u000a            // once the file is written let's email a link to it...\u000a        }\u000a    ]);\u000a});\u000a```\u000a\u000aFor a complicated series of async tasks using the auto function makes adding\u000anew tasks much easier and makes the code more readable.\u000a\u000a\u000a---------------------------------------\u000a\u000a<a name=\"iterator\" />\u000a### iterator(tasks)\u000a\u000aCreates an iterator function which calls the next function in the array,\u000areturning a continuation to call the next one after that. It's also possible to\u000a'peek' the next iterator by doing iterator.next().\u000a\u000aThis function is used internally by the async module but can be useful when\u000ayou want to manually control the flow of functions in series.\u000a\u000a__Arguments__\u000a\u000a* tasks - An array of functions to run.\u000a\u000a__Example__\u000a\u000a```js\u000avar iterator = async.iterator([\u000a    function(){ sys.p('one'); },\u000a    function(){ sys.p('two'); },\u000a    function(){ sys.p('three'); }\u000a]);\u000a\u000anode> var iterator2 = iterator();\u000a'one'\u000anode> var iterator3 = iterator2();\u000a'two'\u000anode> iterator3();\u000a'three'\u000anode> var nextfn = iterator2.next();\u000anode> nextfn();\u000a'three'\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"apply\" />\u000a### apply(function, arguments..)\u000a\u000aCreates a continuation function with some arguments already applied, a useful\u000ashorthand when combined with other control flow functions. Any arguments\u000apassed to the returned function are added to the arguments originally passed\u000ato apply.\u000a\u000a__Arguments__\u000a\u000a* function - The function you want to eventually apply all arguments to.\u000a* arguments... - Any number of arguments to automatically apply when the\u000a  continuation is called.\u000a\u000a__Example__\u000a\u000a```js\u000a// using apply\u000a\u000aasync.parallel([\u000a    async.apply(fs.writeFile, 'testfile1', 'test1'),\u000a    async.apply(fs.writeFile, 'testfile2', 'test2'),\u000a]);\u000a\u000a\u000a// the same process without using apply\u000a\u000aasync.parallel([\u000a    function(callback){\u000a        fs.writeFile('testfile1', 'test1', callback);\u000a    },\u000a    function(callback){\u000a        fs.writeFile('testfile2', 'test2', callback);\u000a    }\u000a]);\u000a```\u000a\u000aIt's possible to pass any number of additional arguments when calling the\u000acontinuation:\u000a\u000a```js\u000anode> var fn = async.apply(sys.puts, 'one');\u000anode> fn('two', 'three');\u000aone\u000atwo\u000athree\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"nextTick\" />\u000a### nextTick(callback)\u000a\u000aCalls the callback on a later loop around the event loop. In node.js this just\u000acalls process.nextTick, in the browser it falls back to setImmediate(callback)\u000aif available, otherwise setTimeout(callback, 0), which means other higher priority\u000aevents may precede the execution of the callback.\u000a\u000aThis is used internally for browser-compatibility purposes.\u000a\u000a__Arguments__\u000a\u000a* callback - The function to call on a later loop around the event loop.\u000a\u000a__Example__\u000a\u000a```js\u000avar call_order = [];\u000aasync.nextTick(function(){\u000a    call_order.push('two');\u000a    // call_order now equals ['one','two']\u000a});\u000acall_order.push('one')\u000a```\u000a\u000a<a name=\"times\" />\u000a### times(n, callback)\u000a\u000aCalls the callback n times and accumulates results in the same manner\u000ayou would use with async.map.\u000a\u000a__Arguments__\u000a\u000a* n - The number of times to run the function.\u000a* callback - The function to call n times.\u000a\u000a__Example__\u000a\u000a```js\u000a// Pretend this is some complicated async factory\u000avar createUser = function(id, callback) {\u000a  callback(null, {\u000a    id: 'user' + id\u000a  })\u000a}\u000a// generate 5 users\u000aasync.times(5, function(n, next){\u000a    createUser(n, function(err, user) {\u000a      next(err, user)\u000a    })\u000a}, function(err, users) {\u000a  // we should now have 5 users\u000a});\u000a```\u000a\u000a<a name=\"timesSeries\" />\u000a### timesSeries(n, callback)\u000a\u000aThe same as times only the iterator is applied to each item in the array in\u000aseries. The next iterator is only called once the current one has completed\u000aprocessing. The results array will be in the same order as the original.\u000a\u000a\u000a## Utils\u000a\u000a<a name=\"memoize\" />\u000a### memoize(fn, [hasher])\u000a\u000aCaches the results of an async function. When creating a hash to store function\u000aresults against, the callback is omitted from the hash and an optional hash\u000afunction can be used.\u000a\u000aThe cache of results is exposed as the `memo` property of the function returned\u000aby `memoize`.\u000a\u000a__Arguments__\u000a\u000a* fn - the function you to proxy and cache results from.\u000a* hasher - an optional function for generating a custom hash for storing\u000a  results, it has all the arguments applied to it apart from the callback, and\u000a  must be synchronous.\u000a\u000a__Example__\u000a\u000a```js\u000avar slow_fn = function (name, callback) {\u000a    // do something\u000a    callback(null, result);\u000a};\u000avar fn = async.memoize(slow_fn);\u000a\u000a// fn can now be used as if it were slow_fn\u000afn('some name', function () {\u000a    // callback\u000a});\u000a```\u000a\u000a<a name=\"unmemoize\" />\u000a### unmemoize(fn)\u000a\u000aUndoes a memoized function, reverting it to the original, unmemoized\u000aform. Comes handy in tests.\u000a\u000a__Arguments__\u000a\u000a* fn - the memoized function\u000a\u000a<a name=\"log\" />\u000a### log(function, arguments)\u000a\u000aLogs the result of an async function to the console. Only works in node.js or\u000ain browsers that support console.log and console.error (such as FF and Chrome).\u000aIf multiple arguments are returned from the async function, console.log is\u000acalled on each argument in order.\u000a\u000a__Arguments__\u000a\u000a* function - The function you want to eventually apply all arguments to.\u000a* arguments... - Any number of arguments to apply to the function.\u000a\u000a__Example__\u000a\u000a```js\u000avar hello = function(name, callback){\u000a    setTimeout(function(){\u000a        callback(null, 'hello ' + name);\u000a    }, 1000);\u000a};\u000a```\u000a```js\u000anode> async.log(hello, 'world');\u000a'hello world'\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"dir\" />\u000a### dir(function, arguments)\u000a\u000aLogs the result of an async function to the console using console.dir to\u000adisplay the properties of the resulting object. Only works in node.js or\u000ain browsers that support console.dir and console.error (such as FF and Chrome).\u000aIf multiple arguments are returned from the async function, console.dir is\u000acalled on each argument in order.\u000a\u000a__Arguments__\u000a\u000a* function - The function you want to eventually apply all arguments to.\u000a* arguments... - Any number of arguments to apply to the function.\u000a\u000a__Example__\u000a\u000a```js\u000avar hello = function(name, callback){\u000a    setTimeout(function(){\u000a        callback(null, {hello: name});\u000a    }, 1000);\u000a};\u000a```\u000a```js\u000anode> async.dir(hello, 'world');\u000a{hello: 'world'}\u000a```\u000a\u000a---------------------------------------\u000a\u000a<a name=\"noConflict\" />\u000a### noConflict()\u000a\u000aChanges the value of async back to its original value, returning a reference to the\u000aasync object.\u000a","readmeFilename":"README.md","bugs":{"url":"https://github.com/caolan/async/issues"},"_attachments":{}}