Registry / storage / node-stream-cache

node-stream-cache

JSON →
library0.0.4jsnpmunverified

A Node.js package that allows streaming data into a Redis cache and retrieving it as a stream. Version 0.0.4 is the latest release; no recent updates indicate active maintenance. It provides a simple API to cache the output of a function that returns a readable stream, with a configurable TTL. Unlike more comprehensive caching solutions, this package focuses solely on stream-based Redis caching with a minimal interface.

npm install node-stream-cache
INSTALL
IMPORT
SIG · NODE-STREAM-CACHE
N
node-stream-cache
storagejavascriptv0.0.4
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.

Cache
var Cache = require('node-stream-cache')
import Cache from 'node-stream-cache'
This package does not support ES module imports; use CommonJS require.

Demonstrates caching a request stream in Redis with a 60-second TTL.

var Cache = require('node-stream-cache'); var cacher = new Cache(); var request = require('request'); var JSONStream = require('JSONStream'); var work = function () { var parser = JSONStream.parse(['rows', true]); var req = request({url: 'http://isaacs.couchone.com/registry/_all_docs'}); req.pipe(parser); return parser; }; var done = function (stream) { stream.pipe(require('event-stream').mapSync(function (data) { console.error(data); return data; })); }; cacher.process('docs', work, done, 60);
Debug
Known issues
deprecatedPackage has not been updated since 2013 and uses outdated API patterns.
fix
Consider alternatives like ioredis or redis-stream.
affects: >=0.0.0
gotchaRequires a running Redis instance; no fallback if Redis is unavailable.
fix
Ensure Redis server is accessible before using this package.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
Redis server is not running or not reachable.
fix
Start Redis server locally or provide correct connection settings.
TypeError: stream is not a function
The 'work' function must return a readable stream; it may be returning undefined.
fix
Ensure the work function returns a valid stream object.
Upgrade
Version history
0.0.4latest on npm
Audit
Dependencies
redisrequiredRedis client required for cache operations
Agent activity
17 hits · last 30 days
node
16
Amazon
1
Resources
node-stream-cache — npm install node-stream-cache · libregistry