Registry / messaging / redis-emitter

redis-emitter

JSON →
library0.0.2jsnpmunverified

A lightweight Node.js library that wraps Redis pub/sub channels into an EventEmitter interface. Version 0.0.2, last updated 2014, no release cadence. Differentiator: simple bridge between Redis messaging and Node.js events, but no longer actively maintained or compatible with modern Redis clients (e.g., ioredis). Not recommended for new projects.

npm install redis-emitter
INSTALL
IMPORT
SIG · REDIS-EMITTER
R
redis-emitter
messagingjavascriptv0.0.2
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.

RedisEmitter
const { RedisEmitter } = require('redis-emitter')
const RedisEmitter = require('redis-emitter')
The library exports an object with RedisEmitter as a property; CommonJS require must destructure or use .RedisEmitter
default import
import { RedisEmitter } from 'redis-emitter'
import RedisEmitter from 'redis-emitter'
No default export; ESM users must use named import syntax
RedisEmitter (from 'RedisEmitter' typo)
const { RedisEmitter } = require('redis-emitter')
const RedisEmitter = require('RedisEmitter')
Common mistake: mismatched case in require path; correct is lowercase 'redis-emitter'

Shows creation of RedisEmitter with a Redis client, subscribing and emitting events, and cleanup.

const redis = require('redis'); const { RedisEmitter } = require('redis-emitter'); const redisClient = redis.createClient(process.env.REDIS_URL ?? 'redis://localhost:6379'); const emitter = new RedisEmitter(redisClient); emitter.on('channel:hello', (data) => { console.log('Received:', data); }); emitter.emit('channel:hello', { message: 'world' }); // Remember to quit the Redis client when done setTimeout(() => redisClient.quit(), 1000);
Debug
Known issues
breakingThe package is unmaintained since 2014; it does not support modern redis client versions (>=3.0).
fix
Use a maintained alternative like 'redis-smq' or implement your own EventEmitter wrapper over the 'redis' or 'ioredis' client.
affects: >=0.0.2
deprecatedThe library uses the legacy 'redis' package which has breaking changes in v3+. The methods used are deprecated.
fix
Pin redis to v2.8.* or upgrade to a modern pub/sub library.
affects: >=0.0.2
gotchaRequire path case-sensitivity: some users mistakenly write require('RedisEmitter') (capital R).
fix
Use all lowercase: require('redis-emitter').
affects: >=0.0.2
gotchaThe exported module is an object with property 'RedisEmitter', not the function itself.
fix
Destructure: const { RedisEmitter } = require('redis-emitter');
affects: >=0.0.2
Errors
Common errors & fixes
Cannot find module 'RedisEmitter'
Incorrect require path with capital 'R' and 'E'
fix
Change to require('redis-emitter') all lowercase
TypeError: RedisEmitter is not a constructor
Importing without destructuring the exported object
fix
Use const { RedisEmitter } = require('redis-emitter');
Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED
No Redis server running at the default address
fix
Start a local Redis server or set REDIS_URL environment variable
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
redisrequireddepends on the 'redis' npm package for Redis connections; must be a matching version
Agent activity
19 hits · last 30 days
node
18
OpenAI (training)
1
Resources
redis-emitter — npm install redis-emitter · libregistry