1.4.5 • Published 9 years ago
connect-ioredis v1.4.5
Connect ioRedis
connect-ioredis is a Redis session store backed by ioredis, and is insanely fast :). Requires redis >= 2.0.0 for the SETEX command.
Since this is forked from connect-redis, now we only modified the following version to support ioredis:
- 1.4.5, which is compatible with Sails.js v0.11
Installation
$ npm install connect-ioredisOptions
clientAn existing redis client object you normally get fromredis.createClient()hostRedis server hostnameportRedis server portnottlRedis session TTL in secondsdbDatabase index to usepassPassword for Redis authenticationprefixKey prefix defaulting to "sess:"sentinelsRedis sentinels arraynameRedis sentinels namehostsRedis cluster hosts array, with object ofhostandport- ... Remaining options passed to the redis
new Redis()method.
Usage
Due to npm 1.x changes, we now need to pass connect to the function connect-ioredis exports in order to extend connect.session.Store:
var connect = require('connect')
, RedisStore = require('connect-ioredis')(connect);
connect()
.use(connect.session({ store: new RedisStore(options), secret: 'keyboard cat' })) This means express users may do the following, since express.session.Store points to the connect.session.Store function:
var RedisStore = require('connect-ioredis')(express);License
MIT
1.4.5
9 years ago