Registry / storage / verdaccio-redis-storage

verdaccio-redis-storage

JSON →
library1.2.4jsnpmunverified

A Redis-based storage plugin for Verdaccio, the lightweight private npm proxy registry. Current stable version is 1.2.4 (released 2022-09-26). Since v0.2.5, the library switched from node-redis to ioredis for better performance and cluster support. It stores package metadata in Redis hashes, sets, and strings with a 've:' prefix. Not recommended for large tarballs; use with a proxy like verdaccio-storage-proxy for tarball storage. Includes a CLI for dump/restore operations.

npm install verdaccio-redis-storage
INSTALL
IMPORT
SIG · VERDACCIO-REDIS-ST
V
verdaccio-redis-storage
storagejavascriptv1.2.4
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.

default
import RedisStorage from 'verdaccio-redis-storage';
const RedisStorage = require('verdaccio-redis-storage').default;
ESM default export. If using CommonJS, use require('verdaccio-redis-storage').default (since v1.0.0).
RedisStorage
import RedisStorage from 'verdaccio-redis-storage';
import { RedisStorage } from 'verdaccio-redis-storage';
This package has a single default export. Destructured import will give undefined.
Config
import type { Config } from 'verdaccio-redis-storage';
TypeScript types are exported; use import type for runtime-free type imports.

Shows how to import, configure, and initialize the Redis storage plugin programmatically.

// Install: npm install verdaccio-redis-storage ioredis // In config.yaml (Verdaccio): // store: // redis-storage: // host: 127.0.0.1 // port: 6379 // enableOfflineQueue: true import RedisStorage from 'verdaccio-redis-storage'; import { Config as VerdaccioConfig } from '@verdaccio/types'; const config: VerdaccioConfig = { store: { 'redis-storage': { host: process.env.REDIS_HOST ?? '127.0.0.1', port: parseInt(process.env.REDIS_PORT ?? '6379'), enableOfflineQueue: true, }, }, }; const storage = new RedisStorage(config, { config }); await storage.init(); // List packages const packages = await storage.getPackageMetadata({ name: 'test-pkg' }); console.log(packages);
Debug
Known issues
breakingSince v0.2.5, the underlying Redis client changed from node-redis to ioredis. Existing configurations may break if using node-redis-specific options.
fix
Update Redis connection options to be compatible with ioredis. See ioredis documentation for connection options.
affects: >=0.2.5
gotchaenableOfflineQueue should NOT be set to false during initialization; it is required for plugin bootstrapping.
fix
Set enableOfflineQueue: true in your Redis storage configuration (or omit, as default is true).
affects: >=0.0.0
gotchaLarge tarballs stored in Redis can cause memory issues. Redis is an in-memory database.
fix
Use verdaccio-storage-proxy to offload tarball storage to an external backend (e.g., AWS S3, MinIO).
affects: *
deprecatedThe CLI dump/restore commands do not support token data (as of v1.2.4).
fix
Manually back up Redis keys with prefix 've:token:*' using redis-cli or other tools.
affects: <=1.2.4
Errors
Common errors & fixes
Error: Cannot find module 'ioredis'
ioredis is a peer dependency and must be installed separately.
fix
Run: npm install ioredis
Error: getaddrinfo ENOTFOUND redis-host
The Redis hostname/port provided in config is unreachable.
fix
Verify Redis is running and the host/port configuration is correct. Ensure network connectivity.
TypeError: RedisStorage is not a constructor
CommonJS require without .default when importing an ES module default export.
fix
Use const RedisStorage = require('verdaccio-redis-storage').default;
Upgrade
Version history
1.2.4latest on npm
Audit
Dependencies
verdacciorequiredPlugin is designed to be used as a storage backend for Verdaccio; must be installed alongside Verdaccio.
ioredisrequiredSince v0.2.5, the library uses ioredis as the Redis client.
verdaccio-storage-proxyoptionalRecommended for serving large tarballs to avoid Redis memory issues.
Agent activity
23 hits · last 30 days
node
20
Resources
verdaccio-redis-storage — npm install verdaccio-redis-storage · libregistry