0.1.10 • Published 1 year ago

@duskim/express-store v0.1.10

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

@duskim/express-store

Description

ES6-module MariaDB session storage plugin for express-session. Written in TypeScript and transcompiled to .cjs.

Vitest report

To reproduce these results, please install MariaDB, create a database called 'test' and run

npm run test
 ✓ src/main.vitest.js (10) 4564ms
   ✓ test store methods (10) 4564ms
     ✓ all
     ✓ destroy
     ✓ set with expiry
     ✓ set with no expiry
     ✓ get existing
     ✓ get non-existing
     ✓ clear
     ✓ length
     ✓ touch
     ✓ clears expired sessions 4031ms

 Test Files  1 passed (1)
      Tests  10 passed (10)
   Start at  19:56:02
   Duration  5.43s (transform 100ms, setup 0ms, collect 223ms, tests 4.56s)

Usage

Supports ES6-module or CJS modules

  import expressSession from "express-session"
  import MariaDBSessionStorage from "@duskim/express-store"

  const SessionStore = MariaDBSessionStorage(expressSession.Store)
  
  const sessStore = new SessionStore({
    client: sequelize
  });

  app.use(
    session({
      store: sessStore,
      ...
    })
  );

Implemented Methods

Please see express-session for a description of available store methods.

  • touch(sid, sess, cb)
  • all(cb)
  • length(cb)
  • clear(cb)
  • set(sid, sess, cb)
  • get(sid, cb)
  • destroy(sid, cb)
0.1.10

1 year ago

0.1.0

1 year ago

0.1.2

1 year ago

0.0.3

1 year ago

0.1.1

1 year ago

0.0.2

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.9

1 year ago

0.1.4

1 year ago

0.0.5

1 year ago

0.1.3

1 year ago

0.0.4

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.0.6

1 year ago

0.0.1

1 year ago