Registry / storage / verdaccio-memory

verdaccio-memory

JSON →
library10.4.5jsnpmunverified

An in-memory storage plugin for Verdaccio, the lightweight private npm registry proxy. Current stable version: 10.4.5 (v10 series maintained by the Verdaccio team). Ideal for testing environments and CI/CD pipelines where ephemeral registries are needed. Unlike filesystem-based plugins, it stores packages and metadata in memory, ensuring fast access and automatic cleanup on process exit but losing data on restart. Requires Verdaccio v5+ as a peer dependency. Released on a semver schedule alongside Verdaccio core releases.

npm install verdaccio-memory
INSTALL
IMPORT
SIG · VERDACCIO-MEMORY
V
verdaccio-memory
storagejavascriptv10.4.5
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 Config from 'verdaccio-memory'
import { Config } from 'verdaccio-memory'
The default export is the config factory function. Named exports also exist for advanced use.
VerdaccioMemoryConfig
import { VerdaccioMemoryConfig } from 'verdaccio-memory'
import VerdaccioMemoryConfig from 'verdaccio-memory'
This is a named type export, not a default export. Use for TypeScript configuration.
MemoryStorage
import { MemoryStorage } from 'verdaccio-memory'
const MemoryStorage = require('verdaccio-memory').MemoryStorage
ESM import is recommended; CommonJS require with destructuring also works but not tree-shakable.

Demonstrates starting a Verdaccio instance with in-memory storage using TypeScript. The Config() call creates the plugin instance with optional limit parameter.

import Config from 'verdaccio-memory'; import { startVerdaccio } from 'verdaccio'; const storageConfig = Config({ limit: 1000, // limit number of packages stored }); const app = await startVerdaccio({ storage: storageConfig, // other verdaccio config }); app.listen(4873, () => { console.log('Verdaccio with in-memory storage started on port 4873'); });
Debug
Known issues
breakingv10 drops support for Node.js < 18
fix
Upgrade Node.js to version 18 or higher.
affects: >=10.0.0
deprecatedv9.0.0 renamed the package from 'verdaccio-memory' to 'verdaccio-memory' (same, but breaking internal API changes occurred)
fix
Update import paths: default import now from 'verdaccio-memory' instead of '@verdaccio/memory' (if previously used).
affects: >=9.0.0 <10
gotchaData is not persisted across restarts – all packages and tokens are lost when the process exits
fix
Use only for testing or ephemeral environments. For persistent storage, use verdaccio-fs or verdaccio-s3-storage.
affects: *
deprecatedThe option 'limit' is now a number, previously it accepted an object with 'maxItems'
fix
Pass a number directly: Config(1000) instead of Config({ maxItems: 1000 }).
affects: >=10.0.0
gotchaThe plugin does not support token expiration or revocation; all tokens remain valid until memory is cleared
fix
Use verdaccio-memory only in trusted environments. For token management, integrate a database-backed storage.
affects: *
Errors
Common errors & fixes
TypeError: Cannot destructure property 'add' of 'undefined'
The plugin instance was not initialized correctly; missing call to Config()
fix
const storage = Config(); // not 'new Config()'
Error: Plugin does not have a 'getPackageStorage' method
Verdaccio expects a storage plugin with getPackageStorage, but the plugin API changed in v9
fix
Ensure you are using a compatible version of verdaccio (v5+) and the plugin version matches.
ModuleNotFoundError: Module not found: Error: Can't resolve 'verdaccio-memory'
The package is not installed or import path is wrong (common in monorepos)
fix
Run 'npm install verdaccio-memory' or check that the package is in your dependencies.
Error: 'limit' option must be a positive integer
Passing limit as a string or object instead of a number
fix
Config(1000) or Config({ limit: 1000 }) – but the object form is deprecated; prefer just a number.
Upgrade
Version history
10.4.5latest on npm
Audit
Dependencies
verdacciorequiredPeer dependency; provides the plugin API and runtime
@verdaccio/corerequiredCore types and utilities for Verdaccio plugins
@verdaccio/typesoptionalTypeScript type definitions for plugin compatibility
Agent activity
43 hits · last 30 days
node
38
OpenAI (training)
1
Resources
verdaccio-memory — npm install verdaccio-memory · libregistry