0.0.3 • Published 11 years ago

redis-identity v0.0.3

Weekly downloads
5
License
-
Repository
github
Last release
11 years ago

Build Status

redis-identity

Redis script for mapping external ID's to sequential ones. Adapted from crashlytics.

Install

$ npm install redis-identity

Usage

Pass in a node-redis client, and an optional key to use for the id mappings. The key will default to identity-map.

var redis = require('redis')
  , client = redis.createClient()
  , identity = require('redis-identity')(client);

identity('xxx-123-456', function(err, id){
  // ...
});
var redis = require('redis')
  , client = redis.createClient()
  , identity = require('redis-identity')(client, 'my-id-map');

identity('xxx-123-456', function(err, id){
  // ...
});

TODO

  • script loading/caching with evalsha? not sure the upsides/downsides yet.

License

MIT