{"_id":"@zenfs/streams","_rev":"3-11cf1b363809c6e5520ea4588cc246b9","name":"@zenfs/streams","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.1":{"name":"@zenfs/streams","version":"0.0.1","keywords":["stream","streams","node","polyfill","browser"],"author":{"url":"https://jamespre.dev","name":"James Prevett","email":"jp@jamespre.dev"},"license":"LGPL-3.0-or-later","_id":"@zenfs/streams@0.0.1","maintainers":[{"name":"james-pre","email":"jp@jamespre.dev"}],"homepage":"https://github.com/zen-fs/streams","bugs":{"url":"https://github.com/zen-fs/streams/issues"},"dist":{"shasum":"95fcbf5eccd8f5cc4fbf1c77f68b8aa19bbdd791","tarball":"https://registry.npmjs.org/@zenfs/streams/-/streams-0.0.1.tgz","fileCount":52,"integrity":"sha512-u8MtfV1WS7brJ1E4Fx1RC+Dolww4iaac4qIKv2gDLS9ufjp/aZLdgUE7tdctN+NYiVBBEPtdyCe0D0Xvg9tjsQ==","signatures":[{"sig":"MEUCIQC76KW5zZiNcdelDXEr4eZce+XAEYWEeWGQROr+0Y1c4QIgZo8/tdTXD6xhzQfSlHAvCOP/wj+X8mUMCvf4Ez5S0Vw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":266539},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">= 22"},"exports":{".":"./dist/index.js","./*":"./dist/*.js"},"funding":{"url":"https://github.com/sponsors/james-pre","type":"individual"},"gitHead":"03d81277f36159daebac52086cb8716b31e8db2c","scripts":{"dev":"tsc --build --watch","lint":"eslint src tests","test":"node --test","build":"tsc --build","format":"prettier --write .","spdx:fix":"npx lice -aw src tests/**/*.ts","spdx:check":"npx lice -a src tests/**/*.ts","format:check":"prettier --check .","prepublishOnly":"npm run build"},"_npmUser":{"name":"james-pre","email":"jp@jamespre.dev"},"prettier":{"useTabs":true,"tabWidth":4,"printWidth":150,"arrowParens":"avoid","singleQuote":true,"trailingComma":"es5","experimentalOperatorPosition":"start"},"repository":{"url":"git+https://github.com/zen-fs/streams.git","type":"git"},"_npmVersion":"12.0.2","description":"A modern node:stream polyfill","directories":{},"_nodeVersion":"26.8.1","dependencies":{"buffer":"^6.0.3","@types/node":"^26.0.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^10.1.0","globals":"^17.11.0","utilium":"^3.6.2","prettier":"^3.2.5","@eslint/js":"^10.0.1","typescript":"^6.0.0","typescript-eslint":"^8.58.0"},"_npmOperationalInternal":{"tmp":"tmp/streams_0.0.1_1788820807402_0.3408430074903084","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@zenfs/streams","version":"1.0.0","keywords":["stream","streams","node","polyfill","browser"],"author":{"url":"https://jamespre.dev","name":"James Prevett","email":"jp@jamespre.dev"},"license":"LGPL-3.0-or-later","_id":"@zenfs/streams@1.0.0","maintainers":[{"name":"james-pre","email":"jp@jamespre.dev"}],"homepage":"https://github.com/zen-fs/streams","bugs":{"url":"https://github.com/zen-fs/streams/issues"},"dist":{"shasum":"ee29e6d0208af9ecc3e3a2a02b5b26e52b801c28","tarball":"https://registry.npmjs.org/@zenfs/streams/-/streams-1.0.0.tgz","fileCount":52,"integrity":"sha512-iKlahcPGoEQH2xGvITdQg5+4b0yT7xPjJT+tRqg3Xq4DOuD7SIH+tNt0meE7WnUxTDaZ/zMig7eGtIUXl4LKEQ==","signatures":[{"sig":"MEQCIA5P3XMy2uEuTSjl0usStg8RjuWEi9iTPwvoe3hfYr3HAiAljHE3dPQYFpBsrgErSVft9XZ0jrIkbZYVU6EkfYlVUw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@zenfs%2fstreams@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":266539},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">= 22"},"exports":{".":"./dist/index.js","./*":"./dist/*.js"},"funding":{"url":"https://github.com/sponsors/james-pre","type":"individual"},"gitHead":"220a537ac868d59684c9b95e62039c579204191e","scripts":{"dev":"tsc --build --watch","lint":"eslint src tests","test":"node --test","build":"tsc --build","format":"prettier --write .","spdx:fix":"npx lice -aw src tests/**/*.ts","spdx:check":"npx lice -a src tests/**/*.ts","format:check":"prettier --check .","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:a4bdc09d-604a-40a3-b836-0f0474b5f9a7"}},"prettier":{"useTabs":true,"tabWidth":4,"printWidth":150,"arrowParens":"avoid","singleQuote":true,"trailingComma":"es5","experimentalOperatorPosition":"start"},"repository":{"url":"git+https://github.com/zen-fs/streams.git","type":"git"},"_npmVersion":"11.19.0","description":"A modern node:stream polyfill","directories":{},"_nodeVersion":"26.8.1","dependencies":{"buffer":"^6.0.3","@types/node":"^26.0.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^10.1.0","globals":"^17.11.0","utilium":"^3.6.2","prettier":"^3.2.5","@eslint/js":"^10.0.1","typescript":"^6.0.0","typescript-eslint":"^8.58.0"},"_npmOperationalInternal":{"tmp":"tmp/streams_1.0.0_1788841677311_0.7460257135141328","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@zenfs/streams","version":"1.0.1","description":"A modern node:stream polyfill","funding":{"type":"individual","url":"https://github.com/sponsors/james-pre"},"main":"dist/index.js","types":"dist/index.d.ts","keywords":["stream","streams","node","polyfill","browser"],"type":"module","homepage":"https://github.com/zen-fs/streams","author":{"name":"James Prevett","email":"jp@jamespre.dev","url":"https://jamespre.dev"},"license":"LGPL-3.0-or-later","repository":{"type":"git","url":"git+https://github.com/zen-fs/streams.git"},"bugs":{"url":"https://github.com/zen-fs/streams/issues"},"engines":{"node":">= 22"},"exports":{".":"./dist/index.js","./*":"./dist/*.js"},"publishConfig":{"access":"public","provenance":true},"sideEffects":false,"scripts":{"format":"prettier --write .","format:check":"prettier --check .","spdx:check":"npx lice -a src tests/**/*.ts","spdx:fix":"npx lice -aw src tests/**/*.ts","lint":"eslint src tests","build":"tsc --build","dev":"tsc --build --watch","test":"node --test","prepublishOnly":"npm run build"},"devDependencies":{"@eslint/js":"^10.0.1","eslint":"^10.1.0","globals":"^17.11.0","prettier":"^3.2.5","typescript":"^6.0.0","typescript-eslint":"^8.58.0","utilium":"^3.6.2"},"prettier":{"singleQuote":true,"useTabs":true,"trailingComma":"es5","tabWidth":4,"printWidth":150,"arrowParens":"avoid","experimentalOperatorPosition":"start"},"dependencies":{"@types/node":"^26.0.0","buffer":"^6.0.3"},"gitHead":"db3266c25f2e72f69d5b738e9ef1c848b59f6e0b","_id":"@zenfs/streams@1.0.1","_nodeVersion":"26.8.2","_npmVersion":"11.19.1","dist":{"integrity":"sha512-MJ//6rMWQtonDB8ESvWcFAnm+J4HHvL4ERWthPteKTYRmzh5LUosEoRNEdzGdmzilj4cg31+vrTKpQB69FA7gg==","shasum":"e30953de441715e7a0f8393118e3aece2efd3b88","tarball":"https://registry.npmjs.org/@zenfs/streams/-/streams-1.0.1.tgz","fileCount":52,"unpackedSize":266562,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@zenfs%2fstreams@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIG6/oHL6w95cM3S9ixNZpmJVHiVONLztOWzWQYJRda2uAiEAsVtox9UZ+JEHYfj9oExn3HGqsRbE3QN6ftEbAeaVg9A="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:a4bdc09d-604a-40a3-b836-0f0474b5f9a7"}},"directories":{},"maintainers":[{"name":"james-pre","email":"jp@jamespre.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/streams_1.0.1_1789168342017_0.5175889989385247"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-07T22:40:07.227Z","modified":"2026-09-11T23:12:22.557Z","0.0.1":"2026-09-07T22:40:07.549Z","1.0.0":"2026-09-08T04:27:57.461Z","1.0.1":"2026-09-11T23:12:22.152Z"},"bugs":{"url":"https://github.com/zen-fs/streams/issues"},"author":{"name":"James Prevett","email":"jp@jamespre.dev","url":"https://jamespre.dev"},"license":"LGPL-3.0-or-later","homepage":"https://github.com/zen-fs/streams","keywords":["stream","streams","node","polyfill","browser"],"repository":{"type":"git","url":"git+https://github.com/zen-fs/streams.git"},"description":"A modern node:stream polyfill","maintainers":[{"name":"james-pre","email":"jp@jamespre.dev"}],"readme":"# ZenFS Streams\n\nA modern polyfill for [`node:stream`](https://nodejs.org/api/stream.html).\n\nThis package replaces [`readable-stream`](https://github.com/nodejs/readable-stream) in [ZenFS](https://github.com/zen-fs/core). `readable-stream` made up 10 of the 17 dependencies in the `@zenfs/core` tree and totaled 703 KB unpacked, and it has a number of unresolved problems with its types and legacy code.\n\nIt is written in TypeScript against Node's current implementation, and every exported class is declared `implements` its `node:stream` counterpart.\n\n## Usage\n\n```js\nimport { Readable, Writable, pipeline } from '@zenfs/streams';\n\nawait pipeline(\n\tReadable.from(['hello', ' ', 'world']),\n\tnew Writable({\n\t\twrite(chunk, encoding, callback) {\n\t\t\tconsole.log(chunk.toString());\n\t\t\tcallback();\n\t\t},\n\t})\n);\n```\n\n## Notes\n\n- The only runtime dependency is [`buffer`](https://github.com/feross/buffer), which resolves to the built-in module on Node. `events`, `process`, `abort-controller` and `string_decoder` are not needed: `EventEmitter` and `StringDecoder` are implemented here, and `AbortController` and `queueMicrotask` are used directly.\n- `StringDecoder` decodes UTF-8 with a streaming `TextDecoder`. UTF-16LE is handled separately, since Node drops a trailing odd byte and preserves lone surrogates where the WHATWG decoder replaces both with U+FFFD.\n- Outside Node there is no `process.nextTick`, so callbacks fall back to `queueMicrotask`. Node drains its next-tick queue ahead of the microtask queue; the fallback has no equivalent, so those callbacks interleave with promise continuations rather than preceding them.\n- `finished()` on a WHATWG stream needs the closed-promise symbol that `node:stream` (and this package's `toWeb()`) attaches. A plain `ReadableStream` cannot be observed without consuming it, so it is rejected.\n- `setMaxListeners` is honored as state but never produces Node's `MaxListenersExceededWarning`.\n","readmeFilename":"readme.md"}