Socket
Socket
Sign inDemoInstall

express-session-sqlite

Package Overview
Dependencies
2
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    express-session-sqlite

SQLite-backed session store for express-session written in Typescript


Version published
Weekly downloads
1.3K
increased by19.78%
Maintainers
1
Install size
137 kB
Created
Weekly downloads
 

Changelog

Source

2.0.1 - Sun Mar 22 2020 23:55:58

  • Remove sqlite3 as dependency.
  • Add new driver property to specify the sqlite library to use.

Readme

Source

express-session-sqlite

npm version built with typescript JavaScript Style Guide CircleCI

A session store for express-session using SQLite.

Fully unit tested. PRs welcomed.

Install

$ npm i express-session-sqlite sqlite3 --save

Usage

import sqlite3 from 'sqlite3'
import express from 'express'
import sqliteStoreFactory from 'express-session-sqlite'
import session from 'express-session'

const SqliteStore = sqliteStoreFactory(session)
const app = express()

app.use(session({
    store: new SqliteStore({
      // Database library to use. Any library is fine as long as the API is compatible
      // with sqlite3, such as sqlite3-offline
      driver: sqlite3.Database,
      // for in-memory database
      // path: ':memory:'
      path: '/tmp/sqlite.db',
      // Session TTL in milliseconds
      ttl: 1234,
      // (optional) Session id prefix. Default is no prefix.
      prefix: 'sess:',
      // (optional) Adjusts the cleanup timer in milliseconds for deleting expired session rows.
      // Default is 5 minutes.
      cleanupInterval: 300000
    }),
    //... don't forget other expres-session options you might need
}))

Keywords

FAQs

Last updated on 22 Mar 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc