A JavaScript plugin (v1.1.0) that simplifies access to HTML5 storages (localStorage, sessionStorage) and cookies, with automatic JSON serialization, namespace support, and cookie fallback for old browsers. It provides a unified API for get/set/keys/isEmpty/hasKey operations with dot-path access to nested objects and bulk operations. Unlike raw localStorage, it automatically encodes objects via JSON, supports namespaces to avoid key collisions, and optionally integrates js-cookie for cookie storage. Stable but low maintenance; last updated several years ago.
npm install js-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic usage: import Storages, set/get values with automatic JSON encoding, dot-path access, namespace storage, and utility methods.
Consider using modern alternatives like localForage or simple localStorage API.
Install js-cookie: npm install js-cookie
Check with isSet() or isEmpty() to differentiate missing vs empty.
Use import/require instead of relying on window.Storages.
Add import { Storages } from 'js-storage' at top of file.Install js-cookie: npm install js-cookie and import before js-storage.
Ensure storage is one of Storages.localStorage, Storages.sessionStorage, or Storages.cookieStorage.