# connect-loki

> A Loki.js session store for Connect/Express

Latest version **1.2.0** (published 2021-03-06) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2021-03-06 |
| First published | 2016-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 53 |
| Author | Nicolas Giard |
| Maintainers | ngpixel |
| Keywords | connect-loki, connect-lokijs, loki, lokijs, express-session, express-session-loki, express, expressjs |

## Links

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

## Dependencies (1)

- [lokijs](https://npm.io/package/lokijs.md) ^1.5.11

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.2.0 (latest) — 2021-03-06
- 1.1.0 — 2017-06-30
- 1.0.9 — 2017-01-12
- 1.0.8 — 2016-11-10
- 1.0.7 — 2016-10-30
- 1.0.6 — 2016-08-22
- 1.0.5 — 2016-08-22
- 1.0.4 — 2016-08-22
- 1.0.3 — 2016-08-22
- 1.0.2 — 2016-08-22
- 1.0.1 — 2016-08-22
- 1.0.0 — 2016-08-22

## README

# connect-loki

[![NPM version](http://img.shields.io/npm/v/connect-loki.svg)](https://www.npmjs.com/package/connect-loki)
[![Build Status](https://travis-ci.org/Requarks/connect-loki.svg?branch=master)](https://travis-ci.org/Requarks/connect-loki)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/97c0f52f6fcc471caeccf45827ff3361)](https://www.codacy.com/app/Requarks/connect-loki)
[![Known Vulnerabilities](https://snyk.io/test/github/requarks/connect-loki/badge.svg)](https://snyk.io/test/github/requarks/connect-loki)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/requarks/connect-loki/blob/master/LICENSE)

##### A Loki.js session store for Connect/Express

### Setup

```shell
npm install connect-loki express-session
```

Pass the `express-session` store into `connect-loki` to create a `LokiStore` constructor.

```js
var session = require('express-session');
var LokiStore = require('connect-loki')(session);

var options = {}; // See available options below

app.use(session({
    store: new LokiStore(options),
    secret: 'keyboard cat'
}));
```

### Options

Setting the `path` to the database file is optional but recommended.

Available parameters:

-	`path` Path to the database file. Defaults to `./session-store.db`
-	`autosave` Set `false` to disable save to disk. Defaults to `true`
- `ttl` Duration in seconds to keep stale sessions. Set to `0` to disable TTL. Defaults to `1209600` (14 days)
-	`logErrors` Whether or not to log client errors. Defaults to `false`
	-	If `true`, a default logging function (`console.error`) is provided.
	-	If a function, it is called anytime an error occurs (useful for custom logging)
	-	If `false`, no logging occurs.

### License

MIT

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