{"id":45164,"library":"ioredis-streams","title":"ioredis-streams","description":"ioredis-streams is a lightweight Node.js library (v2.0.0) that wraps ioredis to provide event-driven handling of Redis Streams. It allows developers to easily consume and process stream entries using event emitters, simplifying the typical polling or blocking read pattern. The library is TypeScript-ready with included types and is designed for real-time data pipelines. Compared to raw ioredis usage, it reduces boilerplate by automatically handling stream consumer groups, acknowledgments, and error recovery. It targets active development with a focus on stream ingestion and processing use cases. Key differentiators include its event-driven API and integration with ioredis's connection management.","status":"active","version":"2.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/Zaid-AlOmari/ioredis-streams","tags":["javascript","typescript"],"install":[{"cmd":"npm install ioredis-streams","lang":"bash","label":"npm"},{"cmd":"yarn add ioredis-streams","lang":"bash","label":"yarn"},{"cmd":"pnpm add ioredis-streams","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"required for Redis connection and stream commands","package":"ioredis","optional":false}],"imports":[{"note":"ESM-only package; requires Node.js with ESM support or bundler. CommonJS require will fail.","wrong":"const StreamProcessor = require('ioredis-streams')","symbol":"StreamProcessor","correct":"import { StreamProcessor } from 'ioredis-streams'"},{"note":"Default export does not exist. Must use named import.","wrong":"import StreamProcessor from 'ioredis-streams'","symbol":"StreamProcessor","correct":"import { StreamProcessor } from 'ioredis-streams'"},{"note":"All exports are from the main package entry; no subpath exports.","wrong":"import { ConsumerGroup } from 'ioredis-streams/consumer'","symbol":"ConsumerGroup","correct":"import { ConsumerGroup } from 'ioredis-streams'"}],"quickstart":{"code":"import Redis from 'ioredis';\nimport { StreamProcessor } from 'ioredis-streams';\n\nconst redis = new Redis({ host: 'localhost', port: 6379 });\n\nconst processor = new StreamProcessor(redis, {\n  stream: 'mystream',\n  group: 'mygroup',\n  consumer: 'consumer1',\n  blockMs: 5000,\n});\n\nprocessor.on('data', (entry) => {\n  console.log('Received entry:', entry.id, entry.message);\n  entry.ack();\n});\n\nprocessor.on('error', (err) => {\n  console.error('Error:', err);\n});\n\nprocessor.start();\n\n// Graceful shutdown\nprocess.on('SIGINT', async () => {\n  await processor.stop();\n  redis.disconnect();\n});","lang":"typescript","description":"Shows how to create a StreamProcessor, listen for data events, acknowledge entries, and handle graceful shutdown."},"warnings":[{"fix":"Use import syntax or switch to a bundler that supports ESM.","message":"Library is ESM-only; cannot be required with CommonJS require().","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Always attach 'error' listener before start().","message":"Calling start() without setting up event listeners may cause unhandled errors or memory leaks.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Create the consumer group manually (XGROUP CREATE) before initializing processor.","message":"Consumer group must exist in Redis before using StreamProcessor; otherwise it will throw.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use 'data' event instead of 'message'.","message":"The 'message' event was renamed to 'data' in v2.0.0; 'message' is deprecated.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Call entry.ack() after successful processing.","message":"Entry acknowledgment (ack()) must be called for each entry to avoid reprocessing.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'acknowledg':78 'activ':84 'allow':26 'api':103 'automat':73 'block':43 'boilerpl':71 'case':95 'compar':64 'connect':109 'consum':30,76 'data':62 'design':57 'develop':27,85 'differenti':97 'driven':20,102 'easili':29 'emitt':37 'entri':34 'error':80 'event':19,36,101 'event-driven':18,100 'focus':88 'group':77 'handl':21,74 'includ':53,98 'ingest':91 'integr':105 'ioredi':2,5,15,67,107 'ioredis-stream':1,4 'javascript':111 'key':96 'librari':11,47 'lightweight':9 'manag':110 'node.js':10 'pattern':45 'pipelin':63 'poll':41 'process':32,93 'provid':17 'raw':66 'read':44 'readi':51 'real':60 'real-tim':59 'recoveri':81 'redi':23 'reduc':70 'simplifi':38 'stream':3,6,24,33,75,90 'target':83 'time':61 'type':54 'typescript':50,112 'typescript-readi':49 'typic':40 'usag':68 'use':35,94 'v2.0.0':12 'wrap':14","created_at":"2026-06-07T12:53:40.415880+00:00","updated_at":"2026-06-07T12:53:40.415880+00:00","problems":[{"fix":"Run XGROUP CREATE mystream mygroup $ MKSTREAM in Redis CLI before starting processor.","cause":"Consumer group not created before starting processor.","error":"ERR wrong number of arguments for 'xgroup' command"},{"fix":"Change to import { StreamProcessor } from 'ioredis-streams'.","cause":"Trying to use default import instead of named import.","error":"TypeError: ioRedisStreams_1.StreamProcessor is not a constructor"},{"fix":"Use import syntax or set type: 'module' in package.json.","cause":"Attempting to require() an ESM-only package in a CommonJS file.","error":"SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Zaid-AlOmari/ioredis-streams#readme","github":"https://github.com/Zaid-AlOmari/ioredis-streams","docs":null,"changelog":null,"pypi":null,"npm":"ioredis-streams","openapi_spec":null,"status_page":null,"smithery":null,"categories":["messaging"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}