Redis storage adapter for Keyv
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 = ; const keyv = 'redis://user:pass@localhost:6379';keyv;
Any valid Redis
options will be passed directly through.
e.g:
const 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 = ;const Keyv = ; const keyvRedis = 'redis://user:pass@localhost:6379';const keyv = store: keyvRedis ;
Or reuse a previous Redis instance:
const KeyvRedis = ;const Redis = ;const Keyv = ; const redis = 'redis://user:pass@localhost:6379';const keyvRedis = redis;const keyv = store: keyvRedis ;
License
MIT © Luke Childs