JSPM

  • Created
  • Published
  • Downloads 2544
  • Score
    100M100P100Q116891F
  • License BSD-2-Clause

Event Emitter wrapper for redis

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

Usage

  var Remitter = require( 'remitter' );
  var thing = new Remitter({
    host: '127.0.0.1', // this is default
    port: 6379, // this is default
    password: 'fflks48ow'
  });

  thing.connect( onReady );

  function onReady() {
    thing.on('anEvent', function(someData){
      // you know the deal
    });

    // .... some time later

    thing.emit( 'anEvent', { aMessage: 'sup' } );
  }

Test

  npm test