Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

microlinkhq/keyv-redis

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Redis storage adapter for Keyv.

Last version Coverage Status NPM Status

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

Install

npm install --save keyv ioredis @microlink/keyv-redis

Usage

const Keyv = require('keyv')
const keyv = new Keyv('redis://user:pass@localhost:6379')

Any valid Redis options will be passed directly through.

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('@keyv/redis')
const Keyv = require('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('@keyv/redis')
const Redis = require('ioredis')
const Keyv = require('keyv')

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

License

keyv-redis © microlink.io, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.

microlink.io · GitHub microlink.io · Twitter @microlinkhq

About

Redis storage adapter for Keyv.

Resources

License

Stars

Watchers

Forks

Packages

No packages published