🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@keyvhq/redis

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keyvhq/redis

Redis storage adapter for Keyv

1.4.0
Source
npm
Version published
Weekly downloads
2.2K
-24.84%
Maintainers
2
Weekly downloads
 
Created
Source

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

Usage

const Keyv = require('@keyvhq/core')

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('@keyvhq/redis')
const Keyv = require('@keyvhq/core')

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

Or reuse a previous Redis instance:

const KeyvRedis = require('@keyvhq/redis')
const Keyv = require('@keyvhq/core')
const Redis = require('ioredis')

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

License

@keyvhq/redis © Luke Childs, Released under the MIT License.
Maintained by Microlink with help from contributors.

microlink.io · GitHub @MicrolinkHQ · Twitter @microlinkhq

Keywords

adapter

FAQs

Package last updated on 12 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts