Needlessly Provoking Marsupials

node-redis-scanner

0.2.0 • Public • Published

node-redis-scanner

A Redis scanner for Node.js.

Installation

npm install node-redis-scanner --save

Usage

var
    RedisScanner = require('node-redis-scanner');
 
var
    // see https://github.com/mranney/node_redis#rediscreateclient
    // for RedisScanner arguments
    scanner = new RedisScanner();
 
var
    counterByPattern = {};
 
scanner
    .onMatch('path:to:key:*', function (pattern, match, client, done) {
        if ( ! counterByPattern[pattern]) {
            counterByPattern[pattern] = 0;
        }
        counterByPattern[pattern] += 1;
        done();
    })
    .onMatch('path:to:another-key:*', function (pattern, match, client, done) {
        client.del(match, function (error) {
            done(error);
        });
    })
    .onError(function (error) {
        // your code here
    })
    .onEnd(function () {
        // your code here
    })
    .start(); // let's scan

install

npm i node-redis-scanner

Downloadsweekly downloads

0

version

0.2.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability