store.js is a lightweight, cross-browser wrapper for localStorage with a simple, unified API. Version 2.1.1 is stable, actively maintained, and ships TypeScript definitions. It provides methods like set, get, remove, clear, forEach, and a Node.js shim. Unlike raw localStorage, store.js automatically serializes/deserializes values, handles errors, and has no dependencies. It supports all major browsers and Node.js v6+.
npm install storejsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic CRUD operations with store.js: set, get, remove, clear, forEach, keys, has, and size.
Wrap in try/catch or use store.disabled to check availability.
Use only JSON-serializable values or implement custom serialization.
Use store.forEach() to iterate over key-value pairs.
Replace store.engine with store.area('local') or store.area('session').Use import store from 'storejs' or add a bundler.
Ensure import store from 'storejs'; (not from 'store').
Catch error and notify user to clear storage.
Use store.set('key', 'value') instead.No dependency data recorded yet.