{"_id":"each-async","_rev":"14088","name":"each-async","description":"Async concurrent iterator (async forEach)","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-06-03T09:58:32.000Z","created":"2013-12-01T23:08:07.082Z","2.0.0":"2021-05-03T19:25:40.389Z","1.1.1":"2014-12-29T09:45:08.863Z","1.1.0":"2014-09-20T21:19:39.788Z","1.0.0":"2014-08-13T17:54:11.996Z","0.1.3":"2014-04-29T19:23:06.653Z","0.1.2":"2014-02-07T15:51:39.737Z","0.1.1":"2013-12-07T02:47:15.261Z","0.1.0":"2013-12-01T23:08:07.082Z"},"users":{"axelav":true,"tunnckocore":true,"klaemo":true,"schnarald":true,"itonyyo":true,"aslezak":true,"n370":true,"schnittstabil":true,"sermir":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/each-async.git"},"versions":{"2.0.0":{"name":"each-async","version":"2.0.0","description":"Async concurrent iterator (async forEach)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/each-async.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"keywords":["each","async","asynchronous","iteration","iterate","loop","foreach","parallel","concurrent","array","flow","control flow"],"dependencies":{"onetime":"^1.0.0","set-immediate-shim":"^1.0.0"},"devDependencies":{"ava":"*","xo":"^0.16.0"},"gitHead":"5063c6a8d00e87d82a32f10ed13f2f2daa2d5659","bugs":{"url":"https://github.com/sindresorhus/each-async/issues"},"homepage":"https://github.com/sindresorhus/each-async#readme","_id":"each-async@2.0.0","_nodeVersion":"16.0.0","_npmVersion":"7.5.4","dist":{"shasum":"75cf768eeb2a0baced320ae0a10005e016ccd962","size":2302,"noattachment":false,"key":"/each-async/-/each-async-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/each-async/download/each-async-2.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/each-async_2.0.0_1620069940219_0.961371118853867"},"_hasShrinkwrap":false,"publish_time":1620069940389,"_cnpm_publish_time":1620069940389,"deprecated":"Deprecated. Just use `Promise.all()`."},"1.1.1":{"name":"each-async","version":"1.1.1","description":"Async concurrent iterator (async forEach)","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/each-async"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha --timeout 20000"},"files":["index.js"],"keywords":["each","async","asynchronous","iteration","iterate","loop","foreach","parallel","concurrent","array","flow","control flow"],"dependencies":{"onetime":"^1.0.0","set-immediate-shim":"^1.0.0"},"devDependencies":{"mocha":"*"},"gitHead":"65f7f663e0e1a323c11bd0e036a08f585ab34a9c","bugs":{"url":"https://github.com/sindresorhus/each-async/issues"},"homepage":"https://github.com/sindresorhus/each-async","_id":"each-async@1.1.1","_shasum":"dee5229bdf0ab6ba2012a395e1b869abf8813473","_from":".","_npmVersion":"2.1.16","_nodeVersion":"0.10.32","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"dee5229bdf0ab6ba2012a395e1b869abf8813473","size":2222,"noattachment":false,"key":"/each-async/-/each-async-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/each-async/download/each-async-1.1.1.tgz"},"directories":{},"publish_time":1419846308863,"_cnpm_publish_time":1419846308863,"_hasShrinkwrap":false},"1.1.0":{"name":"each-async","version":"1.1.0","description":"Async concurrent iterator (async forEach)","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/each-async"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["each","async","asynchronous","iteration","iterate","loop","foreach","parallel","concurrent","array","flow","control flow"],"dependencies":{"onetime":"^1.0.0","setimmediate":"^1.0.2"},"devDependencies":{"mocha":"*"},"gitHead":"04687191a7ee25f4059f45aa167d5e593d5f1a53","bugs":{"url":"https://github.com/sindresorhus/each-async/issues"},"homepage":"https://github.com/sindresorhus/each-async","_id":"each-async@1.1.0","_shasum":"d7473d5140a870414d5736a337e596fee14d369b","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"d7473d5140a870414d5736a337e596fee14d369b","size":1524,"noattachment":false,"key":"/each-async/-/each-async-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/each-async/download/each-async-1.1.0.tgz"},"directories":{},"publish_time":1411247979788,"_cnpm_publish_time":1411247979788,"_hasShrinkwrap":false},"1.0.0":{"name":"each-async","version":"1.0.0","description":"Async concurrent iterator (async forEach)","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/each-async"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["each","async","asynchronous","iteration","iterate","loop","foreach","parallel","concurrent","array","flow","control flow"],"dependencies":{"onetime":"^1.0.0"},"devDependencies":{"mocha":"*"},"gitHead":"a633fcbf50f7d4044d187ecc9fd40bbb2bc5c0a5","bugs":{"url":"https://github.com/sindresorhus/each-async/issues"},"homepage":"https://github.com/sindresorhus/each-async","_id":"each-async@1.0.0","_shasum":"f121cf8fbea49cd499fcbb49725bba1d9d613a45","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"f121cf8fbea49cd499fcbb49725bba1d9d613a45","size":1501,"noattachment":false,"key":"/each-async/-/each-async-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/each-async/download/each-async-1.0.0.tgz"},"directories":{},"publish_time":1407952451996,"_cnpm_publish_time":1407952451996,"_hasShrinkwrap":false},"0.1.3":{"name":"each-async","version":"0.1.3","description":"Async concurrent iterator","license":"MIT","main":"each-async.js","repository":{"type":"git","url":"git://github.com/sindresorhus/each-async"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["each-async.js"],"keywords":["each","async","asynchronous","iteration","iterate","loop","foreach","parallel","concurrent","array","flow","control flow"],"devDependencies":{"mocha":"*"},"bugs":{"url":"https://github.com/sindresorhus/each-async/issues"},"homepage":"https://github.com/sindresorhus/each-async","_id":"each-async@0.1.3","dist":{"shasum":"b436025b08da2f86608025519e3096763dedfca3","size":1702,"noattachment":false,"key":"/each-async/-/each-async-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/each-async/download/each-async-0.1.3.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1398799386653,"_cnpm_publish_time":1398799386653,"_hasShrinkwrap":false},"0.1.2":{"name":"each-async","version":"0.1.2","description":"Async concurrent iterator","license":"MIT","main":"each-async.js","repository":{"type":"git","url":"git://github.com/sindresorhus/each-async"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["each-async.js"],"keywords":["each","async","asynchronous","iteration","iterate","loop","foreach","parallel","concurrent","array","flow","control flow"],"devDependencies":{"mocha":"*"},"bugs":{"url":"https://github.com/sindresorhus/each-async/issues"},"homepage":"https://github.com/sindresorhus/each-async","_id":"each-async@0.1.2","dist":{"shasum":"d5b900bd92705ed5b8cad3307a6536adb0f134c6","size":1718,"noattachment":false,"key":"/each-async/-/each-async-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/each-async/download/each-async-0.1.2.tgz"},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1391788299737,"_cnpm_publish_time":1391788299737,"_hasShrinkwrap":false},"0.1.1":{"name":"each-async","version":"0.1.1","description":"Async parallel iterator","license":"MIT","main":"each-async.js","repository":{"type":"git","url":"git://github.com/sindresorhus/each-async"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.8.0"},"scripts":{"test":"mocha"},"files":["each-async.js"],"keywords":["each","async","asynchronous","iteration","iterate","loop","foreach","parallel","concurrent","array","flow","control flow"],"devDependencies":{"mocha":"~1.14.0"},"readmeFilename":"readme.md","bugs":{"url":"https://github.com/sindresorhus/each-async/issues"},"homepage":"https://github.com/sindresorhus/each-async","_id":"each-async@0.1.1","dist":{"shasum":"32bcef7e3cdc741d630e29846348be4ecca624ff","size":1678,"noattachment":false,"key":"/each-async/-/each-async-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/each-async/download/each-async-0.1.1.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1386384435261,"_cnpm_publish_time":1386384435261,"_hasShrinkwrap":false},"0.1.0":{"name":"each-async","version":"0.1.0","description":"Async parallel iterator","license":"MIT","main":"each-async.js","repository":{"type":"git","url":"git://github.com/sindresorhus/each-async"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.8.0"},"scripts":{"test":"mocha"},"files":["each-async.js"],"keywords":["each","async","asynchronous","iteration","iterate","loop","foreach","parallel","concurrent","array","flow","control flow"],"devDependencies":{"mocha":"~1.14.0"},"readmeFilename":"readme.md","bugs":{"url":"https://github.com/sindresorhus/each-async/issues"},"homepage":"https://github.com/sindresorhus/each-async","_id":"each-async@0.1.0","dist":{"shasum":"310339d09e73ab9be1291ce70a5d25e724af46be","size":1667,"noattachment":false,"key":"/each-async/-/each-async-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/each-async/download/each-async-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1385939287082,"_cnpm_publish_time":1385939287082,"_hasShrinkwrap":false}},"readme":"# each-async\n\n> Async concurrent iterator (async forEach)\n\nLike [async.each()](https://github.com/caolan/async#eacharr-iterator-callback), but tiny.\n\nI often use `async.each()` for doing async operations when iterating, but I almost never use the other gadzillion methods in `async`.\n\nAsync iteration is one of the most used async control flow patterns.\n\n**I would strongly recommend using promises instead. You could then use the built-in [`Promise.all()`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise/all), or [`p-map`](https://github.com/sindresorhus/p-map) if you need concurrency control.**\n\n\n## Install\n\n```\n$ npm install --save each-async\n```\n\n\n## Usage\n\n```js\nconst eachAsync = require('each-async');\n\neachAsync(['foo','bar','baz'], (item, index, done) => {\n\tconsole.log(item, index);\n\tdone();\n}, error => {\n\tconsole.log('finished');\n});\n//=> 'foo 0'\n//=> 'bar 1'\n//=> 'baz 2'\n//=> 'finished'\n```\n\n\n## API\n\n### eachAsync(input, callback, [finishedCallback])\n\n#### input\n\nType: `Array`\n\nArray you want to iterate.\n\n#### callback(item, index, done)\n\nType: `Function`\n\nCalled for each item in the array with the following arguments:\n\n- `item`: the current item in the array\n- `index`: the current index\n- `done([error])`: call this when you're done with an optional error. Supplying anything other than `undefined`/`null` will stop the iteration.\n\nNote that order is not guaranteed since each item is handled concurrently.\n\n#### finishedCallback(error)\n\nType: `Function`\n\nCalled when the iteration is finished or on the first error. First argument is the error passed from `done()` in the `callback`.\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","_attachments":{},"homepage":"https://github.com/sindresorhus/each-async#readme","bugs":{"url":"https://github.com/sindresorhus/each-async/issues"},"license":"MIT"}