A streaming wrapper around lru-cache that enables caching of readable streams and writing cached data to writable streams. Current version: 1.0.5 (unstable pre-1.0). Infrequently updated. Key differentiators: provides a simple streaming interface for caching, avoiding manual buffer management. Alternatives like `lru-cache` require manual serialization.
npm install stream-catcherNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a streamCache, cache a readable stream, and write cached data to a writable stream.
Update constructor options to align with lru-cache v2: use `max`, `length`, `maxAge` etc.
Ensure streams are used only once and not modified externally.
Define `length` as a function that returns `(n) => n.length` for buffer-like data.
Use `import StreamCatcher from 'stream-catcher'` or `const StreamCatcher = require('stream-catcher')`.Provide a `length` option function, e.g., `length: (n) => n.length`.
Pass a valid readable stream object to `cache.read(key, stream)`.