An async iterable interface for Redis streams, built on top of ioredis and msgpackr. Version 4.1.0 supports Redis 5+ (6.2+ for claimIdleTime). Provides high-level modules for job queues with workers, retries, backoff, dead-letter queues (import from 'redis-x-stream/queue') and a distributed single-flight cache with two-tier storage (import from 'redis-x-stream/cache'). Features typed parsing, consumer group support with automatic PEL re-delivery, dynamic stream addition, dead consumer recovery via XAUTOCLAIM, flush timers for pending acks, and observability methods (info, groups, consumers, pending). Ships TypeScript declarations. Releases follow semver with monthly cadence.
npm install redis-x-streamNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a RedisStream consumer on 'events', iterates entries with ack-on-iterate, logs parsed key-value pairs, and gracefully quits.
Change `import RedisStream from 'redis-x-stream'` to `import { RedisStream } from 'redis-x-stream'`.Replace `deleteAfterAck: true` with `deleteOnAck: true`.
Replace `stream.close()` with either `await stream.drain()` (graceful) or `await stream.quit()` (immediate).
Always explicitly set `block: Infinity` or a desired value when using consumer groups.
Use `new RedisStream<MyType>({ ... parse: (id, kv) => ({...}) })` and ensure the parse function returns the exact type.Add `"type": "module"` to package.json or rename files to .mjs. Use dynamic import() if needed.
Ensure `streams: ['my-stream']` is an array, not a single string. Use `streams: ['my-stream']` instead of `stream: 'my-stream'`.
Pass a valid ioredis instance via `redisClient` option: `new RedisStream({ streams: ['s'], redisClient: new Redis() })`.Run `npm install redis-x-stream ioredis` and ensure Node.js version >=16 (ESM support).