{"name":"it-merge","version":"1.0.2","description":"Treat one or more iterables as a single iterable","main":"index.js","repository":{"type":"git","url":"git+https://github.com/achingbrain/it.git"},"homepage":"https://github.com/achingbrain/it/tree/master/packages/it-merge","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":"tsc --noEmit","build":"npm run build:types","build:types":"tsc --emitDeclarationOnly --declarationDir dist","prepublishOnly":"npm run build"},"author":{"name":"Alex Potsides","email":"alex@achingbrain.net"},"license":"ISC","dependencies":{"it-pushable":"^1.4.0"},"devDependencies":{"ava":"^3.12.1","it-all":"^1.0.5","nyc":"^15.1.0","standard":"^16.0.3","typescript":"^4.0.2"},"types":"dist/index.d.ts","gitHead":"f2ea738c344180d023664bd2e69b65b3cf6ffcb5","_id":"it-merge@1.0.2","_nodeVersion":"16.3.0","_npmVersion":"lerna/3.22.1/node@v16.3.0+x64 (darwin)","dist":{"integrity":"sha512-bp+h4X3tQ83/a2MvaeP4nRi+52z2AO2y8tf2OzDdaSXKMC0n0gVtHrJUDaE+kiIkBiUtTt1hp7vJHMM0VtCfGA==","shasum":"8139a6621c2f0969d1176a2060b162421e3a1c80","tarball":"http://registry-npm.ywwl.com/it-merge/download/it-merge-1.0.2.tgz","fileCount":7,"unpackedSize":3635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg041LCRA9TVsSAnZWagAA/DgP/2sA/EDDTkA6e5VNYRTY\nNYakZ27/IVItE5BNTV9xPsvzs+0M9UORAcMIM7owUTo4i7IaatiA4j1GslPd\nEm0VWl8VEN65k7I20akhKqs6C1Q1bzHSzSyCgT/CndoQ9CgPbGKXJbNdK7Bj\nAcV+EHHxS2ME2Tukz7UxW1FZGCq7JOn7cQ1l+0rZ7C9BhU0D7rX0jNFaT7RM\n4GM2RbUF/Vg696Xbm9kgMWWaXiILFtBhf/x+61IfGWrecIIBQOO4cyF8SYM7\ngtwqFtfmQEpdHkR4SUJbjkoVs/eqUp2Swz188y/92rMLQZUpKaYkw8dylJgy\naBs81zOp3pBfgLuGygH8//E5xCq1V33H1hnOcQRJfzISHFckCUR+1ZgoRuNZ\nOKUOi144ULYI4Px4OXsyzj2SSQYfBoxJVpoWSLqyPB+Ipw/QgaS3HRfUs2KF\n2E6uq1OGCWw0ErtMaoOMHevo3qskj/5VSgOJ4fZBS3ySbbPC7CHFosdTohic\n7fuWrNDU0KTCAqXgHz9J15IyB007Q4IYmChUBuvZ7/If/yhTcGQbhs25kWGa\n6hHMIUvZdkzP88xRS7vWsNnr26Ut/ifpNnw8pFMKJhpWQvMAW0XDRFvlkGVC\ngQk/Kb5pmsqJBaZKQRM1H27/EjDxcqP2QXCGLImf6rUabZsPmpi0mUw5AYVI\n4Bd2\r\n=d+aJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDuaoo9OYuTrc3851/IHvp8Onf9KGPKjUiN3mw2vEtESgIhAPqXYs/koO2LjfP2X7pOWaFAg3ZVU3dtY9i/X43AlRQ1"}],"size":1691,"noattachment":false,"key":"/it-merge/-/it-merge-1.0.2.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-merge_1.0.2_1624477002940_0.2513709061525504"},"_hasShrinkwrap":false,"readme":"# it-merge\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> Treat one or more iterables as a single iterable\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\nMerge several (async)iterables into one, yield values as they arrive.\n\nNb. sources are iterated over in parallel so the order of emitted items is not guaranteed.\n\n## Example\n\n```javascript\nimport merge from 'it-merge'\nimport all from 'it-all'\n\n// This can also be an iterator, generator, etc\nconst values1 = [0, 1, 2, 3, 4]\nconst values2 = [5, 6, 7, 8, 9]\n\nconst arr = all(merge(values1, values2))\n\nconsole.info(arr) // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9\n```\n\nAsync sources must be awaited:\n\n```javascript\nimport merge from 'it-merge'\nimport all from 'it-all'\n\n// This can also be an iterator, async iterator, generator, etc\nconst values1 = async function * () {\n  yield * [0, 1, 2, 3, 4]\n}\nconst values2 = async function * () {\n  yield * [5, 6, 7, 8, 9]\n}\n\nconst arr = await all(merge(values1(), values2()))\n\nconsole.info(arr) // 0, 1, 5, 6, 2, 3, 4, 7, 8, 9  <- nb. order is not guaranteed\n```\n\n# Install\n\n```console\n$ npm i it-merge\n```\n\n## Browser `<script>` tag\n\nLoading this module through a script tag will make it's exports available as `ItMerge` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/it-merge/dist/index.min.js\"></script>\n```\n\n# API Docs\n\n- <https://achingbrain.github.io/it/modules/it_merge.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-merge/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](https://github.com/achingbrain/it/blob/main/packages/it-merge/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":1624477003105,"_cnpm_publish_time":1624477003105,"dist-tags":{"latest":"3.0.15"}}