Registry / storage / kvs-redis

kvs-redis

JSON →
library2.2.3jsnpmunverified

Redis adapter for the kvs key-value store abstraction. Version 2.2.3, maintained regularly. Provides a pluggable backend that implements the kvs interface (createBucket, get, set, delete) using Redis. Supports standard Redis connection options and integrates with kvs's bucket-based hierarchical storage. Differentiates from raw Redis clients by offering a unified kvs API with automatic serialization, bucket isolation, and lifecycle management.

npm install kvs-redis
INSTALL
IMPORT
SIG · KVS-REDIS
K
kvs-redis
storagejavascriptv2.2.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Store
import { Store } from 'kvs'
import { Store } from 'kvs-redis'
Store is exported by kvs, not kvs-redis, but used in conjunction
Bucket
import { Bucket } from 'kvs'
import { Bucket } from 'kvs-redis'
Bucket interface from kvs; not directly from adapter
redis (node_redis)
import { createClient } from 'redis'
import Redis from 'kvs-redis'
Redis client is a separate dependency; configure via Store.create options

Shows how to create a Redis-backed store using kvs, including Redis client setup, bucket creation, and basic get/set operations.

import { Store } from 'kvs'; import { createClient } from 'redis'; const redisClient = createClient({ url: process.env.REDIS_URL ?? 'redis://localhost:6379' }); await redisClient.connect(); const store = new Store('redis', { client: redisClient, prefix: 'myapp:' }); const bucket = await store.createBucket('users', {}); await bucket.set('user:1', { name: 'Alice' }); const user = await bucket.get('user:1'); console.log(user.name); await redisClient.quit();
Debug
Known issues
breakingVersion 2.x uses kvs v2 API with bucket-based storage instead of direct store access
fix
Migrate from store.get/set to store.createBucket().get/set
affects: >=2.0.0
deprecatedThe old direct Redis client option is deprecated; use 'client' key in options
fix
Pass Redis client instance as option { client: yourClient }
affects: >=1.0.0 <2.0.0
gotchaIf Redis client is not connected, operations will fail silently or throw
fix
Always await redisClient.connect() before using store
affects: all
gotchaDefault key prefix is 'kvs:' which may conflict with other apps using same Redis
fix
Use unique prefix in Store options
affects: all
Errors
Common errors & fixes
Error: The client is closed
Redis client not connected before store usage
fix
Call `await redisClient.connect()` before creating Store
TypeError: store.createBucket is not a function
Using kvs v1 API with kvs-redis v2
fix
Update kvs to v2 and use new bucket API
ReplyError: MOVED 1234 127.0.0.1:6380
Redis cluster not properly configured
fix
Use a Redis client that supports cluster mode (e.g., ioredis) and configure accordingly
Upgrade
Version history
2.2.3latest on npm
Audit
Dependencies
kvsrequiredPeer dependency; provides Store and bucket abstractions
redisrequiredRuntime dependency; used to connect to Redis server
Agent activity
14 hits · last 30 days
node
14
Resources
kvs-redis — npm install kvs-redis · libregistry