Skip to content

bahmutov/keyv-redis

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@keyv/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 keyv @keyv/redis

Usage

const Keyv = require('keyv');

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

Any valid redis.createClient() 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 Keyv = require('keyv');
const KeyvRedis = require('@keyv/redis');

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

License

MIT © Luke Childs

About

Redis storage adapter for Keyv

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%