connect-redispade

A Redis session store adapter for connect middleware, backed by Spade.

npm install connect-redispade
8 downloads in the last week
16 downloads in the last month

Connect Redispade

build status NPM version

A Redis session store adapter for connect, backed by Spade.


Install

 $ npm install bop [-g]
 // clone repo
 $ git clone git@github.com:rootslab/connect-redispade.git

Install / Update dependencies and devDependencies

 $ cd connect-redispade/
 $ npm install --dev
 # update
 $ npm update --dev

require:

var RedisStore  = require( 'connect-redispade' );

Run Tests

$ cd connect-redispade/
$ npm test

Constructor

Create an instance.

RedisStore( [ Object opt ] )
// or
new RedisStore( [ Object opt ] )

Options

Default options are :

RedisStore.options = {
    // specify an existing Spade client
    client : null,
    host : 'localhost',
    port : 6379,
    // key prefix
    prefix : 'sess:',
    // auth option for Spade
    pass : null,
    ttl : 86400,
    // don't touch db option for now
    db : null,
    // file descriptor
    socket : null,
    // Spade debug level, 0-3
    debug : 0
};

Properties

// a property that holds the initial config object:
RedisStore.options : Object
// the current used Redis client
RedisStore.client : Spade

Methods

RedisStore#set( String sid, String value, Function cback ) : null

RedisStore#get( String sid, Function cback ) : null

RedisStore#destroy( String sid, Function cback ) : null

Events

'connect' : function ( Object address, Number timestamp ) {}
'disconnect' : function ( Number timestamp ) {}
npm loves you