A wrapper around localStorage providing JSON value handling, caching, and a consistent Storage interface. Version 0.1.14 is current. The library offers LocalStorage (real browser storage with availability checks), MemoryStorage (for testing, with optional shared instances), and CachedStorage (buffers writes and flushes on delay/tab blur). It differs from similar libraries by including onExternalChange listeners and byte size reporting. Ideal for apps needing robust browser storage with testability and performance optimizations.
npm install web-browser-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: store and retrieve JSON, check localStorage availability, and listen for external changes.
Check availability by wrapping localStorage access in try/catch instead.
Use { stringifyStoredValues: false } in constructor to keep types intact.Use flush() manually or rely on tab blur event. Not suitable for critical data.
Check availability with LocalStorage.isAvailable() before operations.
Handle with try/catch or use LocalStorage constructor option 'onFull'.
Upgrade to >=0.1.0 where all classes are named exports.
No dependency data recorded yet.