web-storage-es6 is a lightweight ES6 library that provides an abstraction layer over the HTML5 web storage APIs (localStorage and sessionStorage) plus an in-memory global storage. Version 1.2.0 is the current stable release. It offers namespace isolation, batch operations (populate/append), and fallback defaults. Unlike raw storage APIs, it serializes objects automatically and prevents common pitfalls like repetitive writes. The library has minimal overhead and no external dependencies, making it suitable for browser-based projects where a simple, predictable storage wrapper is needed over alternatives like localForage or store.js.
npm install web-storage-es6No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates all major storage operations: create instances of Local, Session, Global storage; set, get, check, populate, append, forget, flush, pull, and retrieve all data.
Use the exact strings: 'Local', 'Session', 'Global'.
Do not rely on underscore-prefixed methods; use public API only.
Use 'Global' only for temporary single-page data. Consider 'Local' or 'Session' for persistence.
Only store JSON-serializable data (strings, numbers, objects, arrays, booleans, null).
Use a polyfill or transpile with Babel for IE11 and below.
Correct import: import WebStorageES6 from 'web-storage-es6' or const WebStorageES6 = require('web-storage-es6').Use one of: 'Local', 'Session', 'Global'.
Create an instance first: const store = new WebStorageES6('Local'); then call store.get().No dependency data recorded yet.