Registry / storage / node-persist-manager

node-persist-manager

JSON →
library2.0.2jsnpmunverified

node-persist-manager is a TypeScript-based asynchronous storage manager for Node.js that provides a simple key-value persist layer with a file-based backend. It is designed to be lightweight and easy to use for local data persistence in Node.js applications. The current stable version is 2.0.2, released with a focus on modern Node.js runtimes (v20.19+, v22.13+, v24+). It offers a straightforward API with methods like getItem, setItem, removeItem, and clear, and uses a manager pattern for managing storage contexts. Compared to other packages like node-persist or lowdb, it is largely unmaintained and has a very narrow engine support range, making it risky for production use.

npm install node-persist-manager
INSTALL
IMPORT
SIG · NODE-PERSIST-MANAG
N
node-persist-manager
storagejavascriptv2.0.2
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.

NodeStorageManager
import { NodeStorageManager } from 'node-persist-manager';
const NodeStorageManager = require('node-persist-manager');
Package is ESM-only. CommonJS require will not work.
NodeStorage
import { NodeStorage } from 'node-persist-manager';
If you need the storage class directly.
default
import NodePersist from 'node-persist-manager';
Default export may not exist; prefer named imports.
Type definitions
import type { StorageOptions } from 'node-persist-manager';
TypeScript types are bundled with the package.

Demonstrates creating a storage context, setting, getting, removing, and clearing key-value data asynchronously.

import { NodeStorageManager } from 'node-persist-manager'; import { join } from 'path'; async function main() { const storageManager = new NodeStorageManager(); const storage = storageManager.createContext('myApp'); // Set an item await storage.setItem('user', { name: 'Alice', age: 30 }); // Get an item const user = await storage.getItem('user'); console.log('User:', user); // Remove an item await storage.removeItem('user'); // Clear all items await storage.clear(); } main().catch(console.error);
Debug
Known issues
breakingEngine requirement: Node.js >=20.19.0 <21.0.0 || >=22.13.0 <23.0.0 || >=24.0.0 <25.0.0 - will not install on older or incompatible Node versions.
fix
Use Node.js version that satisfies the engine range, or downgrade to a compatible earlier version.
affects: >=2.0.0
gotchaNo persistence guarantees across process restarts if storage file is corrupted or missing; no built-in backup mechanism.
fix
Implement your own backup or error handling for file corruption.
affects: all
deprecatedPackage is in maintenance mode with minimal updates; may have unaddressed issues.
fix
Consider migrating to more actively maintained storage solutions like lowdb or node-persist.
affects: all
Errors
Common errors & fixes
ERR_MODULE_NOT_FOUND: Cannot find module 'node-persist-manager'
The package is ESM-only and requires importing using ES modules syntax (import).
fix
Use `import { NodeStorageManager } from 'node-persist-manager';` instead of `require()`.
TypeError: storageManager.createContext is not a function
Incorrect import: likely using default import when named import is needed.
fix
Import `{ NodeStorageManager }` instead of `NodeStorageManager` as default.
Error: The engine "node" is incompatible with this module. Expected version ">=20.19.0 <21.0.0 || >=22.13.0 <23.0.0 || >=24.0.0 <25.0.0".
Your Node.js version does not satisfy the engine requirements.
fix
Update Node.js to one of the supported versions (e.g., 20.19.x, 22.13.x, or 24.x).
Upgrade
Version history
2.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Amazon
1
Resources
node-persist-manager — npm install node-persist-manager · libregistry