Socket
Socket
Sign inDemoInstall

better-sqlite3-session-store

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    better-sqlite3-session-store

A session store for express-session.


Version published
Weekly downloads
902
decreased by-1.2%
Maintainers
1
Install size
5.32 MB
Created
Weekly downloads
 

Readme

Source

better-sqlite3-session-store

npm version workflow status

better-sqlite3-sessions-store provides a better-sqlite3 session storage for express-session.

Install

$ npm i --save better-sqlite3-session-store

Usage

const sqlite = require("better-sqlite3");
const session = require("express-session")

const SqliteStore = require("better-sqlite3-session-store")(session)
const db = new sqlite("sessions.db", { verbose: console.log });

app.use(
  session({
    store: new SqliteStore({
      client: db, 
      expired: {
        clear: true,
        intervalMs: 900000 //ms = 15min
      }
    }),
    secret: "keyboard cat",
    resave: false,
  })
)

License

See License.

Changelog

0.1.0

  • Use correct temporal unit for express's cookie.maxAge (it's milliseconds)
  • Make calling cb function parameter safe
    • (breaking) Remove TypeScript support

0.0.3

  • Add TypeScript support
  • Add (optional) all method

0.0.2

  • Bug fix: For almost all Store methods, when an error was caught, their execution wasn't stopped with e.g. a return statement

0.0.1

  • Release initial version

Inspiration

To build this library, I looked at other session stores:

Keywords

FAQs

Last updated on 25 Jun 2022

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