Package Exports
- remitter
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (remitter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Description
Redis is awesome. But have you seen how one accomplishes pub/sub with the (otherwise incredibly awesome) redis module? Good ol' fashion event emitting/listening but using redis instead of node's native event emitter.
Get Deps
Redis needs to be running somewhere. Tests need mocha installed.
Install
npm install remitter --saveUsage
const Remitter = require('remitter');
const thing = Remitter(process.env.REDIS_URL);
thing
.connect()
.then(() => {
thing.on('foo', (foo) => {
console.log('foo'); // { beep: 'boop' }
});
});
// .... elsewhere in your app - maybe even another process!
const thing2 = Remitter(process.env.REDIS_URL);
thing2
.connect()
.then(() => {
thing2.emit('foo', { beep: 'boop' });
});
}Test
npm test