Registry / messaging / redis-streams-nodejs

redis-streams-nodejs

JSON →
library1.1.5jsnpmunverified

A Node.js library for building Redis Streams consumers and producers. Version 1.1.5 releases on npm; maintained sporadically. Wraps node-redis, providing classes RedisClient, RedisConsumer, and RedisProducer for group-based stream consumption with built-in retry and acknowledgment. Ships TypeScript types. Differs from raw ioredis or node-redis by offering higher-level consumer group abstractions and a listen() method with executable functions.

npm install redis-streams-nodejs
INSTALL
IMPORT
SIG · REDIS-STREAMS-NODE
R
redis-streams-nodejs
messagingjavascriptv1.1.5
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.

RedisClient
import { RedisClient } from 'redis-streams-nodejs'
import RedisClient from 'redis-streams-nodejs'
Default export does not exist; named export only.
RedisConsumer
import { RedisConsumer } from 'redis-streams-nodejs'
const RedisConsumer = require('redis-streams-nodejs').RedisConsumer
CommonJS require is valid but ESM import is recommended. TypeScript types are included.
RedisProducer
import { RedisProducer } from 'redis-streams-nodejs'
Named export. Both ESM and CJS supported.

Creates a Redis client, producer, and consumer for Redis Streams. Shows basic produce and listen workflow.

import { RedisClient } from 'redis-streams-nodejs'; const client = new RedisClient({ socket: { host: 'localhost', port: 6379 }, groupName: 'mygroup', clientName: 'myclient1' }); (async () => { client.on('error', err => console.log('Redis Client Error', err)); await client.connect(); const producer = client.createProducer(); await producer.produce('mystream', { key: 'value' }); const consumer = client.createConsumer(); const stream = { name: 'mystream', executable: (data, stream) => { console.log('Received message for stream', stream, data); } }; consumer.listen(stream); })();
Debug
Known issues
breakingRequires Redis server 6.2+ for consumer group features. Older versions will fail on group creation.
fix
Upgrade Redis server to 6.2 or later. Use 'client.createGroup()' only on supported versions.
affects: all
deprecatedThe 'streamExists' and 'groupExists' methods rely on direct Redis commands that may change in future node-redis versions.
fix
Check for method availability in node-redis and replace with custom SISMEMBER logic if needed.
affects: <=1.1.5
gotchaclientName must be unique per consumer; using duplicate names causes consumer group conflicts.
fix
Generate unique clientName per instance, e.g., 'client-${uuid}'.
affects: all
gotchaIf the Redis stream does not exist before creating a consumer group, consumer creation fails.
fix
Call streamExists() and createGroup() before creating a consumer, or ensure stream exists.
affects: all
Errors
Common errors & fixes
TypeError: client.connect is not a function
Missing await on client.connect() or importing default instead of named export.
fix
Use 'await client.connect();' and 'import { RedisClient } from 'redis-streams-nodejs'.'
Error: NOGROUP No such key 'mystream' or consumer group does not exist
Attempting to listen on a stream without a consumer group.
fix
Create the consumer group first: 'await client.createGroup('mystream');'
Error: CONFIG SET failed (read-only)
Connecting to a read-only Redis replica.
fix
Connect to a writable master node.
Upgrade
Version history
1.1.5latest on npm
Audit
Dependencies
redisrequiredPeer dependency; wraps node-redis for Redis client functionality.
Agent activity
19 hits · last 30 days
node
18
OpenAI (training)
1
Resources
redis-streams-nodejs — npm install redis-streams-nodejs · libregistry