{"name":"it-pair","version":"2.0.6","description":"pair a source async iterable stream and a sink async iterable stream","author":{"name":"Alan Shaw"},"license":"Apache-2.0 OR MIT","homepage":"https://github.com/alanshaw/it-pair#readme","repository":{"type":"git","url":"git+https://github.com/alanshaw/it-pair.git"},"bugs":{"url":"https://github.com/alanshaw/it-pair/issues"},"engines":{"node":">=16.0.0","npm":">=7.0.0"},"type":"module","types":"./dist/src/index.d.ts","typesVersions":{"*":{"*":["*","dist/*","dist/src/*","dist/src/*/index"],"src/*":["*","dist/*","dist/src/*","dist/src/*/index"]}},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"},"./duplex":{"types":"./dist/src/duplex.d.ts","import":"./dist/src/duplex.js"}},"eslintConfig":{"extends":"ipfs","parserOptions":{"sourceType":"module"}},"release":{"branches":["master"],"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits","releaseRules":[{"breaking":true,"release":"major"},{"revert":true,"release":"patch"},{"type":"feat","release":"minor"},{"type":"fix","release":"patch"},{"type":"docs","release":"patch"},{"type":"test","release":"patch"},{"type":"deps","release":"patch"},{"scope":"no-release","release":false}]}],["@semantic-release/release-notes-generator",{"preset":"conventionalcommits","presetConfig":{"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","section":"Trivial Changes"},{"type":"docs","section":"Documentation"},{"type":"deps","section":"Dependencies"},{"type":"test","section":"Tests"}]}}],"@semantic-release/changelog","@semantic-release/npm","@semantic-release/github","@semantic-release/git"]},"scripts":{"clean":"aegir clean","lint":"aegir lint","dep-check":"aegir dep-check","build":"aegir build","test":"aegir test","test:chrome":"aegir test -t browser --cov","test:chrome-webworker":"aegir test -t webworker","test:firefox":"aegir test -t browser -- --browser firefox","test:firefox-webworker":"aegir test -t webworker -- --browser firefox","test:node":"aegir test -t node --cov","test:electron-main":"aegir test -t electron-main","release":"aegir release","docs":"aegir docs"},"dependencies":{"it-stream-types":"^2.0.1","p-defer":"^4.0.0"},"devDependencies":{"aegir":"^38.1.6","it-all":"^3.0.1","it-drain":"^3.0.1","it-pipe":"^3.0.1"},"gitHead":"8350da589a9efc619dcb103bcb6444b825f2ec9d","_id":"it-pair@2.0.6","_nodeVersion":"18.15.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-5M0t5RAcYEQYNG5BV7d7cqbdwbCAp5yLdzvkxsZmkuZsLbTdZzah6MQySYfaAQjNDCq6PUnDt0hqBZ4NwMfW6g==","shasum":"072defa6b96f611af34e0b0c84573107ddb9f28f","tarball":"http://registry-npm.ywwl.com/it-pair/download/it-pair-2.0.6.tgz","fileCount":15,"unpackedSize":12073,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8aLZu/I5FRDcDuU+TZ9A+/3dxanvwt5FkXHLp6dxciAIhAMyKseLOK1z7qvMKh2m4QFLa6NgRcYWhaBSZdQX3TrSj"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPj42ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxYA/+Pu0Y1w7Ikc6KkDr0BlMDjxk1cFfz1Jpnm7V22G0wnzDyaewm\r\nxXpiCb94aZismAeszpFna4p3PhbFkvS+QyJLjq9zzgSBe11elTOkTWegG/e1\r\neofEC8Sapi8ccDkPDN5ZbneA6+DQDcneyQDTY5faoxDahTObW5Npca2NprTS\r\ntH1XLZLxbJKXwSqkaLxHQJpbWv8cnHs97E3jfD2hdl+BxZcHXqTqqgRoqpOI\r\nVRPf+ErqM3LlQ6pVaX60WTvUhAZ5LL7mGdoP5qBYpsMCTAcaZL18BVTqO3HQ\r\nzAX/Te1VymEuzBAP5rgO98epNtCRJ3XRKaKKGY7sqpGkgU+rNl/PSp8+oT7y\r\nsSBggWz8CT2+2WxnvXwCvqqn1YSOI+vmDoHvlz6pj00YzsPpEPDfFpKJH7h0\r\nnRb9xe+JM5E+eY9CQ8anVtzWizueN8sKX8SYXewOt9s27YGmOGqSRsQ7xwK+\r\n7tDQ1XayOWpEqMjYKWfzcwd5ezhCE71UOlgzOUeehl++zqMdkRcIdBTWff3h\r\nnU1INMKijMKGmchf3946oqk71GTfJelslGA7Rk9ckTHLQQRdVnquzK5Yq2k+\r\nSBnCVxirYfa42jLxu8MnVGQY93S38qriiH3YJk8ZiT3jEgXUzwKKzJ9jM6Du\r\n88SWBSQXwz/eXfqhMdPl2hNYUDOY5f9063Y=\r\n=cq86\r\n-----END PGP SIGNATURE-----\r\n","size":4157,"noattachment":false,"key":"/it-pair/-/it-pair-2.0.6.tgz"},"_npmUser":{"name":"alanshaw","email":"alan138@gmail.com"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"alanshaw","email":"alan138@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/it-pair_2.0.6_1681800758311_0.9747766174458923"},"_hasShrinkwrap":false,"readme":"# it-pair <!-- omit in toc -->\n\n[![codecov](https://img.shields.io/codecov/c/github/alanshaw/it-pair.svg?style=flat-square)](https://codecov.io/gh/alanshaw/it-pair)\n[![CI](https://img.shields.io/github/actions/workflow/status/alanshaw/it-pair/js-test-and-release.yml?branch=master\\&style=flat-square)](https://github.com/alanshaw/it-pair/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)\n\n> pair a source async iterable stream and a sink async iterable stream\n\n## Table of contents <!-- omit in toc -->\n\n- [Install](#install)\n  - [Browser `<script>` tag](#browser-script-tag)\n- [API Docs](#api-docs)\n- [License](#license)\n- [Contribution](#contribution)\n\n## Install\n\n```console\n$ npm i it-pair\n```\n\n### Browser `<script>` tag\n\nLoading this module through a script tag will make it's exports available as `ItPair` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/it-pair/dist/index.min.js\"></script>\n```\n\nA pair of {source, sink} streams that are internally connected,\n(what goes into the sink comes out the source)\n\nThis can be used to construct pipelines that are connected.\n\n```js\nimport { pipe } from 'it-pipe'\nimport { pair } from 'it-pair'\n\nvar p = pair()\n\n//read values into this sink...\npipe([1, 2, 3], p.sink)\n\n//but that should become the source over here.\nconst values = await pipe(p.source, async source => {\n  const values = []\n  for await (const value of source) {\n    values.push(value)\n  }\n  return value\n})\n\nconsole.log(values) //[1, 2, 3]\n```\n\nThis is particularly useful for creating duplex streams especially\naround servers. Use `it-pair/duplex` to get two duplex streams\nthat are attached to each other.\n\n```js\nimport { duplexPair } from 'it-pair/duplex'\n\nvar d = duplexPair()\n\n//the \"client\": pipe to the first duplex and get the response.\npipe(\n  [1,2,3],\n  d[0],\n  source => {\n    for await (value of source) {\n      console.log(value) // => 10, 20, 30\n    }\n  }\n)\n\n//the \"server\": pipe from the second stream back to itself\n//(in this case) appling a transformation.\npipe(\n  d[1],\n  source => (async function * () {\n    for await (const e of source) {\n      yield e*10\n    }\n  })(),\n  d[1]\n)\n```\n\n## API Docs\n\n- <https://alanshaw.github.io/it-pair>\n\n## License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](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":1681800758578,"_cnpm_publish_time":1681800758578,"dist-tags":{"latest":"2.0.6"}}