@keyvjs/redis
Redis storage adapter for Keyv
Last updated a year ago by lukechilds .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @keyvjs/redis 
SYNC missed versions from official npm registry.

@keyvjs/redis keyv

Redis storage adapter for Keyv

Build Status Coverage Status npm

Redis storage adapter for Keyv.

TTL functionality is handled directly by Redis so no timestamps are stored and expired keys are cleaned up internally.

Install

npm install --save @keyvjs/keyv @keyvjs/redis

Usage

const Keyv = require('@keyvjs/keyv');

const keyv = new Keyv('redis://user:pass@localhost:6379');
keyv.on('error', handleConnectionError);

Any valid Redis options will be passed directly through.

e.g:

const keyv = new Keyv('redis://user:pass@localhost:6379', { disable_resubscribing: true });

Or you can manually create a storage adapter instance and pass it to Keyv:

const KeyvRedis = require('@keyvjs/redis');
const Keyv = require('@keyvjs/keyv');

const keyvRedis = new KeyvRedis('redis://user:pass@localhost:6379');
const keyv = new Keyv({ store: keyvRedis });

Or reuse a previous Redis instance:

const KeyvRedis = require('@keyvjs/redis');
const Redis = require('ioredis');
const Keyv = require('@keyvjs/keyv');

const redis = new Redis('redis://user:pass@localhost:6379');
const keyvRedis = new KeyvRedis(redis);
const keyv = new Keyv({ store: keyvRedis });

License

MIT © Luke Childs

Current Tags

  • 2.1.1                                ...           latest (a year ago)

2 Versions

  • 2.1.1                                ...           a year ago
  • 2.1.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (10)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |