redise

redis monitor as event emitter

npm install redise
2 downloads in the last week
4 downloads in the last month

redis e(vents)

build status

The main goal is to make redis monitor an event emitter, eg.

var redis = require('redis'),
    client = redis.createClient();
var redise = require('redise');
    listener = redise.listen(client);

    listener
        .cmd('set')
        .key(/^session/i)
        .do(function() {
            console.log('oh, somebody set session in redis');
        });

    listener
        .cmd('set')
        .key('foo')
        .value('bar')
        .do(function() {
            console.log('oh, somebody set bar on key foo');
        });

});

In general

    listener
        .cmd(command)
        .key(key)
        .value(value)
        .do(callback);

Methods

cmd(command)

command name, optional

key(arg)

takes string on regex, optional

value(arg)

same as key()

do(callback)

takes function callback, mandatory

npm loves you