4.0.1 • Published 2 years ago

@ha-store/redis v4.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

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

4.0.1

2 years ago

4.0.0

2 years ago