Registry / storage / storage-memory

storage-memory

JSON →
library0.0.2jsnpmunverified

A lightweight in-memory storage library for JavaScript, version 0.0.2. Provides a simple key-value store with get/set/remove/clear operations, similar to localStorage but in memory. No server or persistence needed. Useful for testing, mocking, or temporary data. Minimal API with no dependencies.

npm install storage-memory
INSTALL
IMPORT
SIG · STORAGE-MEMORY
S
storage-memory
storagejavascriptv0.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.

StorageMemory
import StorageMemory from 'storage-memory'
const StorageMemory = require('storage-memory')
Package exports a default class. No named exports.
StorageMemory
const StorageMemory = require('storage-memory').default
const StorageMemory = require('storage-memory')
CommonJS users must access .default property.

Basic usage: create an in-memory store, set, get, remove, and clear items.

import StorageMemory from 'storage-memory'; const store = new StorageMemory(); store.setItem('key', 'value'); const value = store.getItem('key'); console.log(value); // 'value' store.removeItem('key'); store.clear();
Debug
Known issues
gotchaData is not persistent across page reloads or application restarts.
fix
Use a persistent storage solution like localStorage or IndexedDB for permanent data.
affects: >=0.0.1
gotchaNo built-in expiration or TTL for stored items.
fix
Implement custom expiration logic if needed.
affects: >=0.0.1
Errors
Common errors & fixes
TypeError: StorageMemory is not a constructor
Using require without .default in CommonJS.
fix
Use: const StorageMemory = require('storage-memory').default;
ReferenceError: module is not defined
Using require in an ES module environment.
fix
Use import statement: import StorageMemory from 'storage-memory';
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
23 hits · last 30 days
node
20
OpenAI (training)
1
Resources
storage-memory — npm install storage-memory · libregistry