{"id":44817,"library":"eflex-mqemitter-redis","title":"mqemitter-redis","description":"Redis-powered MQEmitter for pub/sub messaging with MQTT-like wildcards. Version 4.0.1 is the latest stable release, maintained under the mqemitter ecosystem. It uses ioredis internally, creates two Redis connections, and supports all ioredis options. Designed for Node.js with an async/emit callback pattern, it does not handle errors in the callback.","status":"active","version":"4.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/mcollina/mqemitter-redis","tags":["javascript","redis","mqemitter","emitter","pubsub","publish","subscribe"],"install":[{"cmd":"npm install eflex-mqemitter-redis","lang":"bash","label":"npm"},{"cmd":"yarn add eflex-mqemitter-redis","lang":"bash","label":"yarn"},{"cmd":"pnpm add eflex-mqemitter-redis","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core MQEmitter interface; this package extends it.","package":"mqemitter","optional":false},{"reason":"Redis client library used for connectivity.","package":"ioredis","optional":false}],"imports":[{"note":"ESM default import is standard; CommonJS require also works.","wrong":"const mqemitterRedis = require('mqemitter-redis')","symbol":"default","correct":"import mqemitterRedis from 'mqemitter-redis'"},{"note":"Named export for TypeScript type compatibility.","wrong":"","symbol":"MQEmitterRedis","correct":"import { MQEmitterRedis } from 'mqemitter-redis'"},{"note":"Common mistake: trying to import named export instead of default.","wrong":"import { mqemitterRedis } from 'mqemitter-redis'","symbol":"mqemitterRedis","correct":"import mqemitterRedis from 'mqemitter-redis'"}],"quickstart":{"code":"import mqemitterRedis from 'mqemitter-redis';\n\nconst mq = mqemitterRedis({\n  host: process.env.REDIS_HOST ?? 'localhost',\n  port: parseInt(process.env.REDIS_PORT ?? '6379'),\n  password: process.env.REDIS_PASSWORD ?? ''\n});\n\nmq.on('hello/world', (message, cb) => {\n  console.log('Received:', message);\n  cb();\n});\n\nmq.emit({ topic: 'hello/world', payload: 'test' }, () => {\n  console.log('Emitted');\n  mq.close();\n});","lang":"typescript","description":"Connects to Redis, subscribes to a topic with wildcards, emits a message, and closes the connection."},"warnings":[{"fix":"Always call cb() with no argument; if error handling is needed, implement externally.","message":"Callback in 'on' must not pass an error; emitter cannot handle it.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Check maxclients setting on Redis server; adjust ioredis options to reuse connections if needed.","message":"Two Redis connections are created; ensure Redis server allows multiple connections.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pass Redis options directly to constructor instead of using a store object.","message":"The 'store' pattern from earlier versions might be deprecated; use plain opts.","severity":"deprecated","affected_versions":"<4.0.0"},{"fix":"Ensure only ioredis is installed; do not install the 'redis' package.","message":"Requires ioredis, not redis (node_redis). Mixing clients causes unexpected behavior.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'4.0.1':17 'async/emit':46 'callback':47,56 'connect':35 'creat':32 'design':41 'ecosystem':27 'emitt':60 'error':53 'handl':52 'intern':31 'ioredi':30,39 'javascript':57 'latest':20 'like':14 'maintain':23 'messag':10 'mqemitt':2,7,26,59 'mqemitter-redi':1 'mqtt':13 'mqtt-like':12 'node.js':43 'option':40 'pattern':48 'power':6 'pub/sub':9 'publish':62 'pubsub':61 'redi':3,5,34,58 'redis-pow':4 'releas':22 'stabl':21 'subscrib':63 'support':37 'two':33 'use':29 'version':16 'wildcard':15","created_at":"2026-06-07T12:51:59.344861+00:00","updated_at":"2026-06-07T12:51:59.344861+00:00","problems":[{"fix":"Use import mqemitterRedis from 'mqemitter-redis' then call mqemitterRedis(opts).","cause":"Importing the module incorrectly or not instantiating.","error":"TypeError: mq.on is not a function"},{"fix":"Start Redis or set REDIS_HOST and REDIS_PORT environment variables.","cause":"Redis server not running or wrong host/port.","error":"Error: connect ECONNREFUSED 127.0.0.1:6379"},{"fix":"Use default import: import mqemitterRedis from 'mqemitter-redis'","cause":"Using named import incorrectly.","error":"MQEmitterRedis is not a constructor"}],"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/mcollina/mqemitter-redis","github":"https://github.com/mcollina/mqemitter-redis","docs":null,"changelog":null,"pypi":null,"npm":"eflex-mqemitter-redis","openapi_spec":null,"status_page":null,"smithery":null,"categories":["messaging","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}}