A fork of readable-stream (v3.6.1) modified to remove circular dependencies, ensuring compatibility with Rollup and Vite production builds. It provides Node.js stream primitives (Readable, Writable, Transform, Duplex, PassThrough) in browser environments. Unlike the original readable-stream, this version eliminates circular require/import chains that cause Vite to fail during tree-shaking or bundling. It is primarily intended as a shim for libraries like react-pdf that depend on Node.js streams in browser contexts.
npm install vite-compatible-readable-streamVerified import paths — ran on the pinned version, not inferred.
Creates and consumes a simple readable stream emitting numbers 1 to 5.
Upgrade to v3.6.1 or ensure Node.js >= 6.
Test thoroughly if migrating from readable-stream to this fork.
Change `import Stream from 'vite-compatible-readable-stream'` to `import { Readable } from 'vite-compatible-readable-stream'`.Replace all imports from 'readable-stream' with 'vite-compatible-readable-stream'.
Monitor upstream readable-stream releases and consider alternatives if features are missing.
Use conditional imports or detect environment to switch between native stream and this polyfill.
Replace 'readable-stream' with 'vite-compatible-readable-stream' in package.json and imports.
Ensure you are using correct class: Readable for readable streams, Writable for writable streams.
Run `npm install vite-compatible-readable-stream` or add to package.json dependencies.
Import specific classes: `import { Readable, Writable, Transform, Duplex, PassThrough } from 'vite-compatible-readable-stream'`.