`readable-web-to-node-stream` is a utility package designed to seamlessly convert a Web-API `ReadableStream` (typically obtained from browser `fetch` responses or other Web Streams API sources) into a Node.js `Readable` stream. This conversion allows developers to process data originating from web contexts using familiar Node.js stream APIs and utilities, integrating browser-side streaming capabilities with Node.js backend processing. The current stable version is 5.0.0. The package maintains an active release cadence, frequently incorporating improvements and addressing breaking changes, notably the migration to a pure ECMAScript Module (ESM) in version 4.0.0. Key differentiators include its singular focus on this specific conversion direction, first-class TypeScript support, and a clear distinction from its complementary package for the reverse conversion. It targets modern JavaScript environments, requiring Node.js version 18 or newer.
npm install readable-web-to-node-streamVerified import paths — ran on the pinned version, not inferred.
Demonstrates converting a `fetch` response's Web-API ReadableStream into a Node.js Readable stream and piping it to a file, including error handling.
Update all CommonJS `require()` statements to ESM `import` statements. For older Node.js versions, consider using dynamic `import()` or migrating your project to ESM. Node.js >= 22 provides experimental CJS compatibility for ESM packages.
Explicitly set `{ propagateDestroy: true }` in the `ReadableWebToNodeStream` constructor options if you want the Node.js stream's `destroy` method to also cancel the source Web-API stream, matching behavior of some previous stream implementations or expectations.Upgrade your Node.js environment to version 18 or higher to use versions 4.0.0 and above of this package.
Upgrade to version 3.0.2 or higher to patch known security vulnerabilities in your project's dependency tree.
Replace `const { ReadableWebToNodeStream } = require('readable-web-to-node-stream');` with `import { ReadableWebToNodeStream } from 'readable-web-to-node-stream';`. Ensure your project is configured for ESM (e.g., `"type": "module"` in `package.json`) or upgrade to Node.js v22+ if you need CJS compatibility with ESM packages.Ensure you are running in a browser environment or in a Node.js environment where a global `fetch` API (which commonly provides `ReadableStream` on its response bodies) is available or explicitly polyfilled. For Node.js < 18, or if `fetch` is not globally available, you might need to use a package like `node-fetch` and/or `web-streams-polyfill`.
No dependency data recorded yet.