New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

remitter

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remitter

Event Emitter wrapper for redis

0.1.5
Source
npm
Version published
Weekly downloads
824
4.3%
Maintainers
1
Weekly downloads
 
Created
Source

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 --save

Usage

  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

FAQs

Package last updated on 30 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts