1.0.12 • Published 7 years ago
swint-redis-cache v1.0.12
swint-redis-cache
Warning: This is not the final draft yet, so do not use this until its official version is launched
Installation
$ npm install --save swint-redis-cacheOptions
host:String, default:'localhost'pass:String, default:''port:Number, default:6379db:Number, default:0- Methods
.set(key, data, ttl, callback)key:Stringdata:Objectttl:Numbercallback:Function
.get(key, callback)key:Stringcallback:Function
Usage
var cacheInst;
new RedisCache(cred, function(err, redisCache) {
cacheInst = redisCache;
// ...
});
// ...
cacheInst.set('foo', data, 30, function(err, reply) {
// ...
});
cacheInst.get('foo', function(err, reply) {
// ...
});