In-memory implementation of the Web Storage API (localStorage/sessionStorage) for testing and server-side environments. v2.1.0, stable and maintained. Lightweight with zero dependencies, mirrors the browser Storage interface exactly. Unlike other storage shims, this is purely memory-based with no persistence, making it ideal for unit tests. Ships as CommonJS only, no TypeScript definitions.
npm install fake-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a FakeStorage instance and demonstrate basic setItem, getItem, length, key, and removeItem usage.
Data is lost on process exit; do not use as a persistent store.
It is a minimal shim; use window.addEventListener if browser storage events are needed.
Be aware that unlimited growth may occur in long-running processes.
Use only for explicit method calls; avoid direct property assignment.
Use 'new FakeStorage()' instead of 'FakeStorage()'.
Run 'npm install fake-storage' and use 'require('fake-storage')'.No dependency data recorded yet.