New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

redis-notifier

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis-notifier

Redis Keyspace Event Notifier

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

Redis KeySpace Event Notifier Build Status

Subscribe To Redis Keyspaced Events (v2.8.x) Using Redis' Newly Released Keyspaced Events Feature You can now subscribe to events that the server emits Depending on the subscription mode you subscribe with when starting the Redis Server.

--notify-keyspace-events <options>

  • K Keyspace events, published with keyspace@ prefix.
  • E Keyevent events, published with keyevent@ prefix.
  • g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ...
  • $ String commands
  • l List commands
  • s Set commands
  • h Hash commands
  • z Sorted set commands
  • x Expired events (events generated every time a key expires)
  • e Evicted events (events generated when a key is evicted for maxmemory)
  • A Alias for g$lshzxe, so that the "AKE" string means all the events.

Getting Started

Using NPM + Package.json, simply just run npm install

If you are using node_redis pre v0.11.0 checkout the tag v0.1.2

Usage / Configuration

Start Redis Server : redis-server CONF --notify-keyspace-events KExe

var redis = require('redis');
var RedisNotifier = require('redis-notifier');

var eventNotifier = new RedisNotifier(redis, {
  redis : { host : '127.0.0.1', port : 6379 },
  expired : true,
  evicted : true,
  logLevel : 'DEBUG' //Defaults To INFO
});

//Listen for event emission
eventNotifier.on('message', function(pattern, channelPattern, emittedKey) {
  var channel = this.parseMessageChannel(channelPattern);
  switch(channel.key) {
    case 'expired':
        this._handleExpired(emittedKey);
      break;
    case "evicted":
      this._handleEvicted(emittedKey);
      break;
    default:
      logger.debug("Unrecognized Channel Type:" + channel.type);
  }
});

Contributing

In lieu of a formal style-guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Release History

  • 0.2.0 updated node_redis connection args, added deinit method
  • 0.1.2 updated logger interface
  • 0.1.1 changed expire attribute to expired
  • 0.1.0 Initial release

License

Licensed under the Apache 2.0 license.

Author

Chris Miller

Keywords

redis

FAQs

Package last updated on 14 Dec 2015

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