{"name":"it-parallel-batch","version":"1.0.8","description":"Takes an async iterator that emits promise-returning functions, invokes them in parallel and emits the results in the same order as the input","main":"index.js","repository":{"type":"git","url":"git+https://github.com/achingbrain/it.git"},"homepage":"https://github.com/achingbrain/it#readme","bugs":{"url":"https://github.com/achingbrain/it/issues"},"scripts":{"test":"ava","lint":"standard","coverage":"nyc --reporter html --reporter lcov ava","clean":"rm -rf .nyc_output coverage dist","check":"npm run build:dep:types && tsc --noEmit","build":"npm run build:types","build:dep:types":"cd node_modules/it-batch && npm run build:types","build:types":"npm run build:dep:types && tsc --emitDeclarationOnly --declarationDir dist","prepublishOnly":"npm run build"},"author":{"name":"Alex Potsides","email":"alex@achingbrain.net"},"license":"ISC","devDependencies":{"ava":"^3.12.1","delay":"^4.3.0","it-all":"^1.0.5","nyc":"^15.1.0","standard":"^16.0.3","typescript":"^4.0.2"},"dependencies":{"it-batch":"^1.0.7"},"typesVersions":{"*":{"*":[".","dist/*"]}},"_id":"it-parallel-batch@1.0.8","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-0K9wJYrdlS1lV7PERpASq5PMiOAHUXnqsszfKeJQWh1NZpgH4oD7jN1htev4U7z6GLNA+7+fDVjW9TJ9yP1DVQ==","shasum":"c59d9761386fa737ee9e13969fe9cf00b1b51d9b","tarball":"http://registry-npm.ywwl.com/it-parallel-batch/download/it-parallel-batch-1.0.8.tgz","fileCount":7,"unpackedSize":8400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJtjVCRA9TVsSAnZWagAAAQcP/R+lDirwUyfzok20MREb\n/xiwpAXT+nSRRqgqbDijBYBfLHbkY4YmwJ5BBpiFS3mN/ORhnF4X9c+spEA6\nYfiqJafUPybdy+o2+VmcW0imBuzYAKGDo1AVp7CG1hYbofBB8sy4GO1fYRru\nS80jFDt4Nvrrtu6pBFZeoF/iS4T9ORk2T1HFdTDH+XN9As3zckvoMKzzCGgz\nbuRIbG77t9QgQC0Fa2H0QcgiKIW0q2tHFhHSv73HUwVBy1IQ54sKAYTCxI+9\nKIFGBR/fXCsC5y6XjgM7PfGgBctyovetu9w6d33ehcmBFRL/G3bKlp5W81Ms\nwi/RF9duzm7KZ7c2bpiYBqLN3qRYqZpcFL15bQC6n2Rs03pCgR9H15xZ86Pu\neKjVxguT4HZWA5hnwrHBAwtvu+2ZDNZEPdDVXPFwQwj0Q1jx/3aV6oJCMg83\nFqBCM3Ls8MUPWAehaVo64t3H7e92ArEqdgPRdI6nkDdD2Aytul63WvfpOPse\npQDlc6FzJMgJ/pvDlCOpEVVmcA5Gm5b6jQ9jDLNpW5sU+Xf80XPizXmRhApW\nVpJ2YGJjaJlXJ2Dmmg249cIRFUTmwNPC0nIS1LcsG4RTQgehD+NkTwdsH9k+\n07I4fzU1eRlhGx7UTYWUTOZnysxTUEyd6CyEbIzagE0XF5IFRw8d60QVyu+n\n5QZC\r\n=mDLC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmtwykI60Tf67kEuBjxJ3EmhpH8RheQOTFqW3baqoHhwIgbaL0SIfiw9/+9rXgsp7IjYYoldmycM6+nkrPE/duzsw="}],"size":2422,"noattachment":false,"key":"/it-parallel-batch/-/it-parallel-batch-1.0.8.tgz"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/it-parallel-batch_1.0.8_1613158612949_0.7855338091616553"},"_hasShrinkwrap":false,"readme":"# it-parallel-batch\n\n[![codecov](https://img.shields.io/codecov/c/github/achingbrain/it.svg?style=flat-square)](https://codecov.io/gh/achingbrain/it)\n[![CI](https://img.shields.io/github/actions/workflow/status/achingbrain/it/js-test-and-release.yml?branch=main\\&style=flat-square)](https://github.com/achingbrain/it/actions/workflows/js-test-and-release.yml?query=branch%3Amain)\n\n> Process (async)iterable values as functions with concurrency control\n\n# About\n\n<!--\n\n!IMPORTANT!\n\nEverything in this README between \"# About\" and \"# Install\" is automatically\ngenerated and will be overwritten the next time the doc generator is run.\n\nTo make changes to this section, please update the @packageDocumentation section\nof src/index.js or src/index.ts\n\nTo experiment with formatting, please run \"npm run docs\" from the root of this\nrepo and examine the changes made.\n\n-->\n\nTakes an async iterator that emits promise-returning functions, invokes them in parallel and emits the results in the same order as the input.\n\nThe final batch may be smaller than the batch size.\n\n## Example\n\n```javascript\nimport parallelBatch from 'it-parallel-batch'\nimport all from 'it-all'\nimport delay from 'delay'\n\n// This can also be an iterator, async iterator, generator, etc\nconst input = [\n  async () => {\n    await delay(500)\n\n    return 1\n  },\n  async () => {\n    await delay(200)\n\n    return 2\n  },\n  async () => {\n    await delay(100)\n\n    return 3\n  }\n]\n\nconst batchSize = 2\n\nconst result = await all(parallelBatch(input, batchSize))\n\nconsole.info(result) // [1, 2, 3]\n```\n\n# Install\n\n```console\n$ npm i it-parallel-batch\n```\n\n## Browser `<script>` tag\n\nLoading this module through a script tag will make it's exports available as `ItParallelBatch` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/it-parallel-batch/dist/index.min.js\"></script>\n```\n\n# API Docs\n\n- <https://achingbrain.github.io/it/modules/it_parallel_batch.html>\n\n# License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](https://github.com/achingbrain/it/blob/main/packages/it-parallel-batch/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](https://github.com/achingbrain/it/blob/main/packages/it-parallel-batch/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)\n\n# Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","publish_time":1613158613045,"_cnpm_publish_time":1613158613045,"dist-tags":{"latest":"3.0.11"}}