@ha-store/redis

4.0.1 • Public • Published

HA-store
High-Availability store

Efficient data fetching



ha-store-redis Dependencies Status


A redis storage plugin for ha-store.

Installing

npm install ha-store-redis

Usage

Store

const store = require('ha-store');
const local = require('ha-store/stores/in-memory');
const remote = require('ha-store-redis');

// v4.x.x
const itemStore = store({
  resolver: getItems,
  cache: {
    enabled: true,
    tiers: [
      {store: local},
      {store: remote('my_namespace', '//0.0.0.0:6379')},
    ],
  },
});

// v3.x.x
const itemStore = store({
  resolver: getItems,
  store: remote('my_namespace', '//0.0.0.0:6379'),
});

It now also supports passing an existing connection object.

const redis = require('redis');
const store = require('ha-store');
const remote = require('ha-store-redis');

const client = redis.createClient('//0.0.0.0:6379');

const itemStore = store({
  resolver: getItems,
  store: remote('my_namespace', null, client),
});

Testing

npm test

Compatibility

This is backwards-compatible with v3.x.x of ha-store.

Contribute

Please do! This is an open source project - if you see something that you want, open an issue or file a pull request.

If you have a major change, it would be better to open an issue first so that we can talk about it.

I am always looking for more maintainers, as well. Get involved.

License

Apache 2.0 (c) Frederic Charette

Readme

Keywords

none

Package Sidebar

Install

npm i @ha-store/redis

Weekly Downloads

0

Version

4.0.1

License

Apache-2.0

Unpacked Size

4.62 kB

Total Files

4

Last publish

Collaborators

  • fed135