simples-redis-store
TypeScript icon, indicating that this package has built-in type declarations

0.9.1 • Public • Published

simples-redis-store 0.9.1

simples-redis-store is a store for simples that is using redis database, it is designed to work with simples starting version 0.9.0.

Install

npm i simples-redis-store

Usage

Basic usage consists in creating a new redis store and providing it to the server configuration.

const simples = require('simples');
const RedisStore = require('simples-redis-store');

const server = simples();
const store = new RedisStore();

server.session({
    enabled: true,
    store
});

In case a client to the database is already created it can be used as a parameter to the redis store constructor like in the following example:

const redis = require('redis');
const simples = require('simples');
const RedisStore = require('simples-redis-store');

const client = redis.createClient(/* Redis client configuration */);
const server = simples();
const store = new RedisStore(client);

server.session({
    enabled: true,
    store
});

The redis client is always available as a property.

store.client; // Redis client

Readme

Keywords

Package Sidebar

Install

npm i simples-redis-store

Weekly Downloads

1

Version

0.9.1

License

MIT

Unpacked Size

4.63 kB

Total Files

4

Last publish

Collaborators

  • micnic