{"id":45155,"library":"ion-streamer","title":"ION Streamer","description":"ION Streamer (v1.3.3) is a Node.js library for producing and consuming Redis streams in a non-blocking manner. It listens to Redis stream entries in a subprocess, enabling async/await-based processing without blocking the main event loop. Released in 2023, it provides a simple API for stream production and consumption with built-in auto-reconnection. The library differentiates itself by leveraging subprocess isolation for stream consumers, preventing backpressure issues, and supports both Node.js and browser environments via the same API.","status":"active","version":"1.3.3","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install ion-streamer","lang":"bash","label":"npm"},{"cmd":"yarn add ion-streamer","lang":"bash","label":"yarn"},{"cmd":"pnpm add ion-streamer","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for Redis client interactions. The library wraps the official redis package for stream commands.","package":"redis","optional":false},{"reason":"Used to generate unique stream entry IDs if not provided.","package":"uuid","optional":true}],"imports":[{"note":"The library provides named exports; default import is not available. Use named import for ESM.","wrong":"const Streamer = require('ion-streamer').Streamer","symbol":"Streamer","correct":"import { Streamer } from 'ion-streamer'"},{"note":"Path import is not necessary; the main entry re-exports all classes.","wrong":"import { Streamer, Consumer } from 'ion-streamer/dist/Consumer'","symbol":"Consumer","correct":"import { Consumer } from 'ion-streamer'"},{"note":"CJS users must destructure the named export. The default export is undefined.","wrong":"const streamer = require('ion-streamer')","symbol":"Streamer","correct":"const { Streamer } = require('ion-streamer')"}],"quickstart":{"code":"import { Streamer, Consumer } from 'ion-streamer';\n\nconst streamer = new Streamer({ redisUrl: process.env.REDIS_URL ?? 'redis://localhost:6379' });\nconst consumer = new Consumer({ streamKey: 'my-stream', groupName: 'my-group', consumerName: 'worker-1', redisUrl: process.env.REDIS_URL ?? 'redis://localhost:6379' });\n\n// Produce a message\nawait streamer.produce('my-stream', { data: 'hello' });\n\n// Consume messages\nconsumer.on('message', (msg) => {\n  console.log(`Received: ${JSON.stringify(msg)}`);\n  return Promise.resolve();\n});\nawait consumer.start();\n\n// Clean up\nprocess.on('SIGINT', async () => {\n  await consumer.stop();\n  await streamer.close();\n  process.exit(0);\n});","lang":"typescript","description":"Demonstrates creating a Streamer and Consumer, producing a stream entry, listening for messages, and handling graceful shutdown with Redis connection."},"warnings":[{"fix":"Use inter-process communication (e.g., send messages via IPC) or avoid relying on shared state. Alternatively, use a different consumer approach if state sharing is required.","message":"Consumer runs in a subprocess, not the same process. This means shared state (e.g., in-memory variables) is not accessible inside the consumer's event handlers.","severity":"gotcha","affected_versions":"<=1.3.3"},{"fix":"Run XGROUP CREATE my-stream my-group $ MKSTREAM manually via redis-cli or via the library's Streamer.createGroup() method before starting the consumer.","message":"The library does not automatically create the Redis stream or consumer group. You must ensure they exist before producing/consuming.","severity":"gotcha","affected_versions":"<=1.3.3"},{"fix":"Replace streamer.send(...) with streamer.produce(...).","message":"The method 'streamer.send' is deprecated in v1.3.0. Use 'streamer.produce' instead.","severity":"deprecated","affected_versions":">=1.3.0"},{"fix":"Implement a health check and restart the consumer on connection loss, or use a more robust library like 'redis-streams-bus' with built-in reconnection.","message":"If Redis connection is lost, the consumer subprocess may exit silently. Auto-reconnect is not implemented for the subprocess consumer.","severity":"gotcha","affected_versions":"<=1.3.3"}],"env_vars":null,"search_vec":"'2023':42 'api':47,84 'async/await-based':32 'auto':58 'auto-reconnect':57 'backpressur':72 'block':20,35 'browser':79 'built':55 'built-in':54 'consum':13,70 'consumpt':52 'differenti':62 'enabl':31 'entri':27 'environ':80 'event':38 'ion':1,3 'isol':67 'issu':73 'javascript':85 'leverag':65 'librari':9,61 'listen':23 'loop':39 'main':37 'manner':21 'node.js':8,77 'non':19 'non-block':18 'prevent':71 'process':33 'produc':11 'product':50 'provid':44 'reconnect':59 'redi':14,25 'releas':40 'simpl':46 'stream':15,26,49,69 'streamer':2,4 'subprocess':30,66 'support':75 'v1.3.3':5 'via':81 'without':34","created_at":"2026-06-07T12:53:38.106357+00:00","updated_at":"2026-06-07T12:53:38.106357+00:00","problems":[{"fix":"Use streamer.createGroup('my-stream', 'my-group') before consumer.start().","cause":"The consumer group has not been created for the stream before starting the consumer.","error":"Error: Consumer group 'my-group' does not exist"},{"fix":"Use streamer.produce() instead.","cause":"Using the deprecated 'send' method which was removed in v1.3.0.","error":"TypeError: streamer.send is not a function"},{"fix":"Run npm install ion-streamer and ensure the import is correct (e.g., 'ion-streamer' not 'ion-streamer/src').","cause":"The package is not installed or there is a typo in the import path.","error":"Error: Cannot find module 'ion-streamer'"},{"fix":"Start Redis server (e.g., docker run -p 6379:6379 redis) or provide correct REDIS_URL environment variable.","cause":"Redis server is not running or the connection URL is incorrect.","error":"Error: connect ECONNREFUSED 127.0.0.1:6379"}],"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":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"ion-streamer","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"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}}