
store.js
A small JavaScript wrapper that saves values in the browser under one simple get/set API.
- Stars
- 14k
- Forks
- 1.3k
- Licence
- MIT
- Language
- JavaScript
- Last update
- 2.8 years ago
- Type
- Library
No commits in over a year — check for forks or alternatives before adopting.
What it is
Store.js is a JavaScript library that gives web pages one simple interface for saving and reading data in the browser, such as get, set, remove and each. It picks the best available storage mechanism in the browser and falls back to others if needed, so the same code can run across many browsers. It also offers optional plugins for features like expiring values, default values and change events.
- Remember a logged-in user's name or preferences between visits with store.set and store.get
- Set default values for settings using the defaults plugin
- Expire temporary values at a set time using the expire plugin
- Get notified when stored values change using the events plugin
Great for
- Front-end developers who need to keep small pieces of data in the browser across page loads
- Teams maintaining sites that must work on older browsers
- Developers who want optional add-ons like expiration or change events without writing them from scratch
Not ideal for
- Projects that only target modern browsers, since the README suggests a smaller modern build and built-in localStorage may be enough
- Apps that need to store large or sensitive data, because browser storage has limits and the README does not describe encryption
- Server-side data needs, since this is aimed at browser storage
How to get it
- 1
Install with a package manager
You'll need: Node.js (only if using npm)
Install with npm
npm i store - 2
Run it
- Install the package with npm i store, or download a build from the dist folder for a script tag
- Import or include store in your page or script
- Call store.set('user', { name:'Marcus' }) to save a value
- Call store.get('user') to read it back
- 3
Get the most out of it
- Use the expire plugin to give stored values a lifetime
- Use the events plugin to react when stored values change
- Use store.everything.min.js if you want all plugins and storages in one file
- Write a custom plugin using the function-returning-object pattern shown in the README
Downloads
Strengths
- Simple get/set/remove/each API with a small surface area
- Falls back across several storage types so code keeps working in many browsers
- Plugin system lets you add only the features you need
Trade-offs
- The README describes browser-specific storage limits and quirks that you must account for
- Plugins and builds add choices that can be confusing for newcomers
- Last push shown is January 2024 and there is no release listed, so check whether it still fits your needs
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| store.js (this) | 14k | Library | beginner | 2.8 years ago | Front-end developers who need to keep small pieces of data in the browser across page loads |
| js-cookie | 22.6k | Library | beginner | 6 days ago | Front-end developers who need to store small pieces of data in cookies on a website |
| lowdb | 22.6k | Library | beginner | 7 months ago | Node.js developers building small tools or prototypes that need simple persistent storage |
| redux-persist | 12.9k | Library | intermediate | 29 days ago | Web developers who want Redux state to survive a page reload |
| webpack | 66k | Dev tool | intermediate | 4 days ago | Frontend developers building single-page or multi-page web apps |
| toon | 25.6k | Library | beginner | 5 days ago | Developers who send structured JSON data to LLM prompts and want to reduce token usage |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.