{"name":"it-merge","version":"1.0.4","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#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":"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.6","nyc":"^15.1.0","standard":"^16.0.3","typescript":"^4.0.2"},"types":"dist/index.d.ts","gitHead":"29126fa87dae108acef381693812f22ac8f9362b","_id":"it-merge@1.0.4","_nodeVersion":"16.8.0","_npmVersion":"lerna/4.0.0/node@v16.8.0+x64 (darwin)","dist":{"integrity":"sha512-DcL6GksTD2HQ7+5/q3JznXaLNfwjyG3/bObaF98da+oHfUiPmdo64oJlT9J8R8G5sJRU7thwaY5zxoAKCn7FJw==","shasum":"81c8d427b389b1cd039c25015edb804cd1a60545","tarball":"http://registry-npm.ywwl.com/it-merge/download/it-merge-1.0.4.tgz","fileCount":7,"unpackedSize":3701,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2wJ5CRA9TVsSAnZWagAAGGgQAJhE8+MfLeeLHGMmKBRp\nF4LgxzkStX5zBRz5saEUn/Tnme6yRRO8IDEAF7EQUnee+1QwNVfFkpUmLO6/\n3YAVQ5YNVkfLjESbYwitHUNMfxjWwSemEqton/WxneR9nSD++Z2o3ST1gdud\nH7PLcN00KoCDIbA6M7tc7yyokatcgXtDOfsCesqFWhU8TuaqDH3AttmWKa8s\nUqD7Rr1q34/zcWGwks8DEIjz/zDAqgj9Tm4gjxS1w8dRVQGR8JWdXpa9T5EL\nIYz1ZMQGb5xYIU/saVWaJ/z8d60cVvB/iC3YCWydVS5E29CRY1i95XmaENld\nqkdlMPfDFKmfNE4aRQpRyjBFDuMPvjlbf9BrgZ7/ejM1a7tqhEhaEx9n8gtI\nWLaY9pUPWrhqMhHzx2buBZ7mohqY8uyzPRgyoFHPR9yZb9YeKV5tSj2hlfo2\nv1CLjnIfAbfimjd09XWOV7k+XKfwbFt660UQnYTTvMCaU2ard/58XHgzmPhW\nepI/OmlCXJkeTzDFyyJao5V6+3HaR/X/6BOqjv/Ajdu1Zoh7cyOJVUrCzEff\ntSotH5ZoL3fWqmWOAqwdQvx53Cgrndx+5gequWyqSZEwVgkEi2bF8qgUyIbL\n7p0GfQTRpHjXvBocH3TrSpm6blQO4Zf+1T8GrDCnmX+fS2FZ0QTEZgJ412ry\nLy0f\r\n=dOB+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHS1iDXKjt75yMeJzHVQnBUgLPdgH4/e2L/BqK/fAfAwAiEAqPMUNyraY6p7Cz8HoHn0YpEwfHsF7O2TeFhUVzyeMwQ="}],"size":1727,"noattachment":false,"key":"/it-merge/-/it-merge-1.0.4.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.4_1633875317465_0.3527616810844467"},"_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":1633875317611,"_cnpm_publish_time":1633875317611,"dist-tags":{"latest":"3.0.15"}}