A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.npmjs.com/package/better-sqlite3-session-store below:

better-sqlite3-session-store - npm

better-sqlite3-session-store0.1.0 • Public • Published 3 years ago

better-sqlite3-session-store

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 0.0.3 0.0.2 0.0.1 Inspiration

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

Package Sidebar Install

npm i better-sqlite3-session-store

Downloads Weekly Downloads Collaborators

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4