@makebestgame/co-redis
v1.0.1
Published
a co-redis lib with centralized config.
Downloads
5
Readme
@makebestgame/co-redis is a co-redis wrapper to be used with visionmedia's co library.
Usage
const redis_config = {
"main": {
"type": "REDIS",
"host": "localhost",
"password": "xxxxx",
"port": 6379
},
"session": {
"type": "REDIS",
"host": "localhost",
"port": 6379,
"db": 6
},
};
var co = require('co');
var redis = require('@makebestgame/co-redis');
redis.init(redis_config);
var redisCo = redis.get('session');
co(function* () {
yield redisCo.set('test', 33);
console.log(yield redisCo.get('test')); // logs 33
});
Installation
$ npm install @makebestgame/co-redis