Registry / storage / stream-cache

stream-cache

JSON →
library0.0.2jsnpmunverified

Node.js package (v0.0.2, unmaintained since 2012) that provides a simple way to cache readable streams, allowing replay and piping even before the source stream finishes. It buffers stream data and exposes a readable stream interface. Not recommended for production; consider alternatives like readable-stream or custom implementations.

npm install stream-cache
INSTALL
IMPORT
SIG · STREAM-CACHE
S
stream-cache
storagejavascriptv0.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

StreamCache
import StreamCache from 'stream-cache'
const StreamCache = require('stream-cache')
No TypeScript types; ESM only if using bundler that supports CJS interop. Original example uses require().
StreamCache (as named export)
import { StreamCache } from 'stream-cache'
const { StreamCache } = require('stream-cache')
This package exports only default, not named. Named import will fail.
new StreamCache()
const cache = new StreamCache()
Constructor expects no arguments.

Creates a stream cache that buffers the content of a file and replays it to stdout.

import StreamCache from 'stream-cache'; import fs from 'fs'; const cache = new StreamCache(); fs.createReadStream('./file.txt').pipe(cache); cache.pipe(process.stdout);
Debug
Known issues
breakingPackage is abandoned; no updates since 2012. No TypeScript definitions, may not work with modern Node.js versions (e.g., streams API changes).
fix
Use a maintained alternative like readable-stream-cache or implement your own using PassThrough.
affects: >=0.0.2
gotchaThe cache stores the entire stream in memory. For large streams, this can cause high memory usage.
fix
Use with streams that are small or implement a streaming cache that limits buffer size.
affects: >=0.0.0
gotchaDoes not handle backpressure correctly. Piping high water mark can cause excessive buffering.
fix
Consider using Node's built-in PassThrough with objectMode: true for simple replay.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'stream-cache'
Package not installed or typo in import path
fix
Run `npm install stream-cache` and ensure import path is correct.
TypeError: stream is not a function
Using CommonJS require with ESM import or misconfiguration
fix
Use `const StreamCache = require('stream-cache');` in CommonJS files.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
32 hits · last 30 days
node
28
Amazon
1
OpenAI (training)
1
Resources
stream-cache — npm install stream-cache · libregistry