Leveldb backed session store for your Express app.
npm install express-session-level express-session
Pass the express-session
store into express-session-level
to create a
LevelStore
constructor.
The LevelStore
constructor accepts a levelUP instance and an optional
options
object.
var session = require('express-session');
var LevelStore = require('express-session-level')(session);
var db = require('level')('./myDb');
app.use(session({
store: new LevelStore(db)
}));
var LevelStore = require('express-session-level')(session);
Pass the express-session
store into express-session-level
to create a
LevelStore
constructor.
Create an express session store as:
var sessionStore = new LevelStore(levelup[, options])
levelup
is an instance of levelUP. You can choose any backing store (levelDown, memDown ...) for the levelup instance.options
:prefix
: all saved keys to database will be prefix with this string. Default to empty string""
.levelTTLOptions
: options will be passed straight to level-ttl. For example:{ defaultTTL: 60000, checkFrequency: 30000 }
level-ttl to handle ttl of saved entries if you dont want the data store to keep growing.
levelup-defaults to make sure we do not polute your levelup instance.
MIT