{"name":"browser-readablestream-to-it","version":"1.0.3","description":"Turns a browser readble stream into an async iterator","main":"index.js","repository":{"type":"git","url":"git+https://github.com/achingbrain/it.git"},"homepage":"https://github.com/achingbrain/it/tree/master/packages/browser-readablestream-to-it#readme","bugs":{"url":"https://github.com/achingbrain/it/issues"},"scripts":{"test":"playwright-test","lint":"standard","coverage":"playwright-test","check":"tsc --noEmit","clean":"rm -rf dist","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","devDependencies":{"chai":"^4.2.0","it-all":"^1.0.6","mocha":"8.0.1","playwright-test":"^0.7.1","standard":"^16.0.3","typescript":"^4.0.2"},"types":"dist/index.d.ts","gitHead":"29126fa87dae108acef381693812f22ac8f9362b","_id":"browser-readablestream-to-it@1.0.3","_nodeVersion":"16.8.0","_npmVersion":"lerna/4.0.0/node@v16.8.0+x64 (darwin)","dist":{"integrity":"sha512-+12sHB+Br8HIh6VAMVEG5r3UXCyESIgDW7kzk3BjIXa43DVqVwL7GC5TW3jeh+72dtcH99pPVpw0X8i0jt+/kw==","shasum":"ac3e406c7ee6cdf0a502dd55db33bab97f7fba76","tarball":"http://registry-npm.ywwl.com/browser-readablestream-to-it/download/browser-readablestream-to-it-1.0.3.tgz","fileCount":7,"unpackedSize":8493,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2lIUCRA9TVsSAnZWagAAoeYP/355KHBLjgG8EnctgOUY\nl5oHiemLhxtMPL7hFtxm5OBZUhYtfTuCzUdhkQ7s2Q73n65WK3rwsSaQzu+6\n+hjUVL7G4sHmnCLvtgWf58RFS3Gn3KGK5Ne7jXZ5BAR44C+4LvetYr9aXDCi\n/9W0QVTtNLZkeUHBk+I0e0FL4gN1EFKE6KuBPYrGzNiSezBj4Qj7to3itu2i\nxlKof4bAn4p4xsx1T+/EO3Wkk4mtRb/rNUvMorrqAtpxa5LJHsMa3OhR4FVt\nFE312+yIyIQuf/U0r4facB5D1O3n2KJllyxE5agJjkpaeGTcgxxSO7T7zdwf\n43385PtFFNiER+AD0nhKkfxqxC4hA6mRR3FtOnQCeOC0or73ApFitFWTzC+W\ntLqCs6F3oici2hV5mC4+LgmP1ZnwD0OtNXT+Bp5Kn6A3UERX+8sQ3dLC87AD\nlsGBQIdVjw1OqPwKI8QpcLyOcwvSDY5wZyQS1ZwrfC8zfGfaUlzPSHQ8Q/Ly\nWxZvlsoMtlRJSaczKFtLn+6LkZ0ECuLA6UrXCh7ErF5OpwOxx355iTGIV+9N\n5POPskfNylMcbOShgDOxqqvHyL7p2pfB5eudCWkxJSWIaccel0JcOfzw+8FG\n3jCE9PYyGxK9mrFw0MltKgPG7Yz/l2yfzBAZ2zG4iKB2Wr7KQSiw8N/+gPU1\nYuCw\r\n=NOze\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXGSP+aC7GeOtRKYcb8UGHwsmWB4dn5zl+h+bA4CfHWwIhAPG3My7NcPM7BCqVN+m/Ft9NzVROKM9OivrQY6pUQo19"}],"size":2363,"noattachment":false,"key":"/browser-readablestream-to-it/-/browser-readablestream-to-it-1.0.3.tgz"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/browser-readablestream-to-it_1.0.3_1633875316154_0.7516070080250645"},"_hasShrinkwrap":false,"readme":"# browser-readablestream-to-it\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> Turns a browser readble stream into an async iterator\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\nAllows treating a browser readable stream as an async iterator.\n\n## Example\n\n```javascript\nimport toIt from 'browser-readablestream-to-it'\nimport all from 'it-all'\n\nconst content = [0, 1, 2, 3, 4]\n\nconst stream = new ReadableStream({\n  start(controller) {\n    for (let i = 0; i < content.length; i++) {\n      controller.enqueue(content[i])\n    }\n\n    controller.close()\n  }\n})\n\nconst arr = await all(toIt(stream))\n\nconsole.info(arr) // 0, 1, 2, 3, 4\n```\n\n## preventCancel\n\nBy default a readable stream will have [.cancel](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/cancel) called on it once it has ended or\nreading has stopped prematurely.\n\nTo prevent this behaviour, pass `preventCancel: true` as an option:\n\n```javascript\nconst arr = await all(toIt(stream, { preventCancel: true }))\n\nconsole.info(arr) // 0, 1, 2, 3, 4\n```\n\n# Install\n\n```console\n$ npm i browser-readablestream-to-it\n```\n\n## Browser `<script>` tag\n\nLoading this module through a script tag will make it's exports available as `BrowserReadablestreamToIt` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/browser-readablestream-to-it/dist/index.min.js\"></script>\n```\n\n# API Docs\n\n- <https://achingbrain.github.io/it/modules/browser_readablestream_to_it.html>\n\n# License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](https://github.com/achingbrain/it/blob/main/packages/browser-readablestream-to-it/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](https://github.com/achingbrain/it/blob/main/packages/browser-readablestream-to-it/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":1633875316300,"_cnpm_publish_time":1633875316300,"dist-tags":{"latest":"2.0.12"}}