{"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":{"integrity":"sha512-szplLpJQ/yZQ4mx5M/tE5ArcwPNrbyQDNby61YQUZ1G2KMAhsJ+aX6voDHDDeV6cYvz0w61SqCAMe9NlbltVPw==","shasum":"75cf768eeb2a0baced320ae0a10005e016ccd962","tarball":"http://registry-npm.ywwl.com/each-async/download/each-async-2.0.0.tgz","fileCount":4,"unpackedSize":4356,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkE40CRA9TVsSAnZWagAA+KgQAJELVwfTs0f+jueh+zmX\nT7SEfnU9jBBq4r3Y4bTWfDOa+uBOPUDo2DkeIIJdNTqjsun6ZBTNh5/6K1pF\nJisMtwPujIqBv3HNYwjLoIDOJ2O9HsVYN/dexcc9v1ax9xoIK9VLll3hIXXW\nnRVVYaxKPWD/wfj77nsp9S2eIhEj9Bqk8A8RrLqeCPt6cvbnak6uciH0hzjw\n9UmDNNgrv+4Po3AWANgg+o3FW4by8dSKhyDzEFtHMcrfzP1hYvqamc7RjiLa\nXvgS6pFdqlFc8MXnlgPR0r6B8z2+uifWaA3FSP3vTC6BQQA6kpwAbO//QUpf\ndmcoYkZk6ZbIe7c5SZ+UXdpXzSttk/MGHdTfqX0VbVWQCxmYi0R9j7OQxhAT\nJEDuIn/18iMdS0BKxjHGmXEf0NZ2FlrtdqCqTBKfXKGSe3Ec8EbEEaEv4GWb\nUctmnxfmZC6oB2w5MF8jlNvFLq8YjriGE/rEs7ft0OB4HGC2OEvgcPxE4Hma\n+CWzmzmWCMebioqd1tnKVTI4Aa/OkT4m6tZZ8iIv4LL6Nan2W4s0HlqqgZf6\nEkDssGdNP7YFktv4efQyDKNhKplozppW89Z5lhlAxpfnm2GAlft/d7Nch741\n58G8Ej/nFsnuUh8IURheGjSuamLUiZaXsTpHGatv2DYYyDmREB1WRu1qFDb5\n8BOI\r\n=k04F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWiHwLMSG9aSPjp/g1ILjFO7mKF5bDTCl/4Jy0QA+MZQIgTmg507CQJvzDlne4R2WWoup8+WGqy/d3Cku1ind5es4="}],"size":2302,"noattachment":false,"key":"/each-async/-/each-async-2.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/each-async_2.0.0_1620069940219_0.961371118853867"},"_hasShrinkwrap":false,"deprecated":"Deprecated. Just use `Promise.all()`.","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","publish_time":1620069940389,"_cnpm_publish_time":1620069940389,"dist-tags":{"latest":"2.0.0"}}