{"name":"it-merge","version":"1.0.1","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","_id":"it-merge@1.0.1","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-1V1wDlzGaPprEGxwRJUMkoKvjZJCaqRp0o7i5fD3LeY7K2ZL5hmtHJnRTXHqJf9wO2ovzOjqxBUtFK4c3HAF0g==","shasum":"74a12045147981777e812a9b098823f2bc8ac882","tarball":"http://registry-npm.ywwl.com/it-merge/download/it-merge-1.0.1.tgz","fileCount":7,"unpackedSize":3656,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJtipCRA9TVsSAnZWagAAn3wP/1oqDkQcrYhEzT0JsJdk\nhXoi04oMxrcF+lgsSa46Yhqdyqv/yOZTmnAe2NbZwzjiMm1ErLnpCNT9j/sy\npI7dh0k62YclepPHYk11OoJMlHXwH4t/7oVWPdxVdqfIWi+TFR5YPgy+/a26\nxmqxY1rl7/9K1vovm4fuy4fl2+G/D7bnm8400nRIsfM17VJLHlYBpCw6hG7c\nzCLWVilfzYdTQ8HMdC2y0RXQZkganvPBb+mh3HuCH6v7lI+47lRpxbAs4WBT\nAmkI8I/1ZA5Iz6mhuL7cWQMtvtFDsI00Y7oaXISvfSXp+cz7d/BIUdbE4E6E\n7avrdqJEltfU5pTpJZMi4MVXlss2ACznkbRtcpub9l5nKmJHsL9s7qcpskyZ\naGnQgz8kgNeNKhBhUrP053IXsvjlChgL9MAay1VHSbKzIGtMeWAKMpVmeU02\nqjIE7jALrBeyWmz4we4XJDirzxN18flT4xmpFb6hfZQipHX+4v/iPuWT4ghP\nD+nQneBkKew514TFosu3xW1Slr1Jpk7zeQoOaS8lcHGlDZuAkJVpcpowwHFE\nDSnRuJLeP3hNs/0BDeCg9cVi10jbnUjY3ZEVqdL05KbUNkJZRBsGL+52y+5K\neNzsVHvwGEtRjM5V7rGgxZyiUiGTChWSK0TssaR1Ynu3Z1ACmnJW1y6ROfTZ\n0yLk\r\n=6iAq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsAIhusGFpdglhFTHJw7YvFF6IsnsnM4bMg2+K72iR3AIgbl3IeAxolONyoW7dZbmkTfBDeitNUKyUif2YXEwcCwI="}],"size":1702,"noattachment":false,"key":"/it-merge/-/it-merge-1.0.1.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.1_1613158569131_0.27961363901073044"},"_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":1613158569402,"_cnpm_publish_time":1613158569402,"dist-tags":{"latest":"3.0.15"}}