express-session-cache-manager

express session support using node-cache-manager

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
express-session-cache-manager
411.0.26 years ago6 years agoMinified + gzip package size for express-session-cache-manager in KB

Readme

express-session-cache-manager
js-standard-style Build Status npm version
express-session support using node-cache-manager, which supports a variety of storage engines.

Installation

npm i express-session-cache-manager --save

Usage

import express from 'express'
import session from 'express-session'
import cacheManager from 'cache-manager'
import CacheManagerStore from 'express-session-cache-manager'

// Replace with your cache-manager specific store engine here
import memoryStoreEngine from 'cache-manager-memory-store'

const app = express()

const sessionMiddleware = session({
  store: new CacheManagerStore(cacheManager.caching({
    store: memoryStoreEngine
  }))
})

app.use(sessionMiddleware)

Extended logging

The debug module is used to provide debug information.
Enable the following environment variable to see them:
DEBUG=session-cache-manager

Acknowledgements