A W3C-compliant DOM Storage (localStorage and sessionStorage) implementation for Node.js, allowing browser-oriented unit tests to run server-side. Version 2.1.0 is stable with no recent releases. It supports in-memory and file-backed storage with configurable strict stringification and JSON whitespace. Unlike alternatives like node-localstorage, this is synchronous and does not emit Storage events. Ideal for simple test mocking, not production use.
npm install dom-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates in-memory and file-backed storage, strict vs non-strict mode, and JSON serialization usage.
Pass { strict: true } to conform to W3C spec (all values as strings).Avoid for large files or high-frequency writes; consider async alternatives.
Use a polyfill or different library if events are needed.
Evaluate alternatives like node-localstorage or simple-memory-storage.
Use require('dom-storage') instead of import.Use strict: true and compare strings, or use non-strict mode and compare values as stored.
Ensure directory exists before constructing with file path.
No dependency data recorded yet.