Gathering detailed insights and metrics for @keyv/valkey
Gathering detailed insights and metrics for @keyv/valkey
Gathering detailed insights and metrics for @keyv/valkey
Gathering detailed insights and metrics for @keyv/valkey
Simple key-value storage with support for multiple backends
npm install @keyv/valkey
Typescript
Module System
Min. Node Version
Node Version
NPM Version
98.3
Supply Chain
99.1
Quality
87.7
Maintenance
100
Vulnerability
99.3
License
TypeScript (99.16%)
Shell (0.38%)
CSS (0.32%)
JavaScript (0.14%)
Total Downloads
224,649
Last Day
2,045
Last Week
52,676
Last Month
117,567
Last Year
224,649
MIT License
2,919 Stars
1,632 Commits
178 Forks
20 Watchers
3 Branches
75 Contributors
Updated on Jul 03, 2025
Minified
Minified + Gzipped
Latest Version
1.0.6
Package Id
@keyv/valkey@1.0.6
Unpacked Size
64.64 kB
Size
10.87 kB
File Count
7
NPM Version
11.4.1
Node Version
20.17.0
Published on
Jun 21, 2025
Cumulative downloads
Total Downloads
Last Day
21.1%
2,045
Compared to previous day
Last Week
48.1%
52,676
Compared to previous week
Last Month
170%
117,567
Compared to previous month
Last Year
0%
224,649
Compared to previous year
1
8
Valkey storage adapter for Keyv
Valkey storage adapter for Keyv.
Valkey is the open source replacement to Redis which decided to do a dual license approach moving forward. Valkey is a drop-in replacement for Redis and is fully compatible with the Redis protocol.
We are using the iovalkey which is a Node.js client for Valkey based on the ioredis
client.
1npm install --save keyv @keyv/valkey
This is using the helper createKeyv
function to create a Keyv instance with the Valkey storage adapter:
1import {createKeyv} from '@keyv/valkey'; 2 3const keyv = createKeyv('redis://localhost:6379'); 4keyv.on('error', handleConnectionError); 5await keyv.set('foo', 'bar'); 6console.log(await keyv.get('foo')); // 'bar'
If you want to specify the KeyvValkey
class directly, you can do so:
1import Keyv from 'keyv'; 2import KeyvValkey from '@keyv/valkey'; 3 4const keyv = new Keyv(new KeyvValkey('redis://user:pass@localhost:6379', { disable_resubscribing: true }));
Or you can manually create a storage adapter instance and pass it to Keyv:
1import Keyv from 'keyv'; 2import KeyvValkey from '@keyv/valkey'; 3 4const KeyvValkey = new KeyvValkey('redis://user:pass@localhost:6379'); 5const keyv = new Keyv({ store: KeyvValkey });
Or reuse a previous Redis instance:
1import Keyv from 'keyv'; 2import Redis from 'iovalkey'; 3import KeyvValkey from '@keyv/valkey'; 4 5const redis = new Redis('redis://user:pass@localhost:6379'); 6const KeyvValkey = new KeyvValkey(redis); 7const keyv = new Keyv({ store: KeyvValkey });
Or reuse a previous Redis cluster:
1import Keyv from 'keyv'; 2import Redis from 'iovalkey'; 3import KeyvValkey from '@keyv/valkey'; 4 5const redis = new Redis.Cluster('redis://user:pass@localhost:6379'); 6const KeyvValkey = new KeyvValkey(redis); 7const keyv = new Keyv({ store: KeyvValkey });
The useRedisSets
option lets you decide whether to use Redis sets for key management. By default, this option is set to true
.
When useRedisSets
is enabled (true
):
clear
function), all keys in the Redis set are looked up for deletion. The set itself is also deleted.Note: In high-performance scenarios, enabling useRedisSets
might lead to memory leaks. If you're running a high-performance application or service, it is recommended to set useRedisSets
to false
.
If you decide to set useRedisSets
as false
, keys will be handled individually and Redis sets won't be utilized.
However, please note that setting useRedisSets
to false
could lead to performance issues in production when using the clear
function, as it will need to iterate over all keys to delete them.
Here's how you can use the useRedisSets
option:
1import Keyv from 'keyv';
2
3const keyv = new Keyv(new KeyvValkey('redis://user:pass@localhost:6379', { useRedisSets: false }));
No vulnerabilities found.
Reason
30 commit(s) and 27 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
SAST tool is run on all commits
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More