Code Monkey home page Code Monkey logo

express-session-level's Introduction

Build Status npm

Leveldb backed session store for your Express app.

Usage

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)
}));

express-session-level

var LevelStore = require('express-session-level')(session);

Pass the express-session store into express-session-level to create a LevelStore constructor.

LevelStore

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 }

Dependencies

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.

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.