# connect-lowdb

> lowdb session store for Connect

Latest version **3.1.0** (published 2024-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install connect-lowdb
pnpm add connect-lowdb
yarn add connect-lowdb
bun add connect-lowdb
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.0 |
| Published | 2024-09-03 |
| First published | 2022-02-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 8.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | travishorn |
| Keywords | connect-session, connect, express, json, lowdb, session, store |

## Links

- npm: https://www.npmjs.com/package/connect-lowdb
- Repository: https://github.com/travishorn/connect-lowdb
- Homepage: https://github.com/travishorn/connect-lowdb#readme
- Issues: https://github.com/travishorn/connect-lowdb/issues
- npm.io page: https://npm.io/package/connect-lowdb

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 3.1.0 (latest) — 2024-09-03
- 3.0.1 — 2024-09-02
- 2.1.0 — 2023-07-04
- 2.0.0 — 2022-02-06
- 1.0.1 — 2022-02-06
- 1.0.0 — 2022-02-06
- 0.2.0 — 2022-02-06

## README

# connect-lowdb

**connect-lowdb** provides [lowdb](https://github.com/typicode/lowdb) session
storage for Express. Requires lowdb ^7.0.0.

## Installation

```bash
npm install lowdb connect-lowdb express-session
```

## API

```javascript
import session from "express-session";
import { JSONFilePreset } from "lowdb/node";
import lowdbStore from "connect-lowdb";

const db = await JSONFilePreset("db.json", null);
const LowdbStore = lowdbStore(session);

app.use(
  session({
    store: new LowdbStore({ db }),
    resave: false,
    saveUninitialized: false,
    secret: "keyboard cat",
  }),
);
```

### LowdbStore(options)

The `LowdbStore` requires an existing [lowdb](https://github.com/typicode/lowdb)
database object.

#### Options

##### db

An instance of `Low` created by [lowdb](https://github.com/typicode/lowdb).

## License

The MIT License (MIT)
Copyright © 2024 Travis Horn

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---
_Source: https://npm.io/package/connect-lowdb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
