localForage
Offline browser storage library with a simple localStorage-like API backed by IndexedDB or WebSQL.
Repository Health
Technical Analysis
localForage improves the offline storage experience of web apps by offering a localStorage-like API backed by asynchronous storage engines — IndexedDB or WebSQL, whichever the browser supports — instead of synchronous, string-only localStorage. It automatically stores values of any type (arrays, objects, blobs, and more) without manual JSON serialization, and falls back to localStorage itself in browsers lacking IndexedDB or WebSQL support.
The library exposes a dual callback/Promise API so it fits either Node-style callback code or modern async/await usage, and it can be extended with custom driver implementations beyond the three built-in storage backends. It ships as a dependency-free single file suitable for a plain <script> tag as well as an npm package for bundler-based projects.
What You Get
- A
localStorage-compatible API (getItem,setItem,removeItem,clear,length,key,keys,iterate) backed by IndexedDB or WebSQL - Automatic driver selection with fallback ordering (IndexedDB → WebSQL → localStorage) and manual driver override via
setDriver() - Native storage of non-string values (objects, arrays, Blobs, ArrayBuffers) without manual JSON encoding
- A dual callback/Promise API, allowing use with
async/awaitor traditional Node-style callbacks - Multiple named instances via
createInstance()for isolated stores within the same origin - An extensible driver API for adding custom storage backends beyond the three built in
Common Use Cases
- Persisting offline-first web app state so it survives page reloads and works without a network connection
- Caching API responses or computed data client-side to reduce redundant network requests
- Storing structured user data (objects, arrays) in the browser without hand-rolling JSON.stringify/parse around localStorage
- Building Progressive Web Apps that need reliable storage across browsers with inconsistent IndexedDB/WebSQL support
- Migrating simple
localStorage-based code to asynchronous storage with minimal API changes
Under The Hood
Architecture - The core src/localforage.js module defines the public API and driver-registration system, delegating actual reads/writes to one of three driver implementations under src/drivers/ (indexeddb.js, websql.js, localstorage.js). At initialization, localForage probes the environment for IndexedDB support, falling back through WebSQL to plain localStorage, and exposes defineDriver() so third-party storage backends can be registered using the same interface. createInstance() produces independent, differently namespaced localForage objects so multiple stores can coexist without key collisions.
Tech Stack - Written in plain JavaScript with no runtime dependencies, built via a Grunt-based pipeline (Gruntfile.js) into both an unbundled dist/localforage.js for direct <script> inclusion and a CommonJS build for npm/bundler consumption. TypeScript typings are maintained separately under typings/ with a dedicated typing-tests suite to catch definition regressions.
Code Quality - The test/ directory includes cross-environment suites for iframes, web workers, service workers, and multiple module-loading styles (require, Browserify, polyfill), reflecting the project’s focus on consistent behavior across the many contexts a browser storage library must run in. However, the repository shows low recent commit activity and infrequent releases (last npm release 2021), so newer browser storage APIs or edge cases may not be actively tracked.
API Design - The API is deliberately a drop-in match for localStorage’s method names and semantics, which keeps the learning curve minimal for anyone who has used browser storage before; the main addition is asynchronicity (callbacks/Promises) and automatic handling of non-string values. This close mirroring is also a constraint — the API surface stays intentionally narrow (no transactions, no querying beyond iterate()), trading power for familiarity.
Used by 15 apps in this directory
APITable
Low Code Platforms · Databases
API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.
Appsmith
Developer Tools · Automation · No Code Platforms
Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.
CodeSandbox
Code Editors · Developer Tools
Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.
Drawnix
Design Tools · Productivity
All-in-one open-source whiteboard combining mind maps, flowcharts, and freehand drawing on a single infinite canvas.
highlight.io
Developer Tools · Analytics · Monitoring
Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.
hoodik
File Storage · Security
Self-hosted, end-to-end encrypted cloud storage with browser-based encryption and S3-compatible storage support
Mattermost
Team Chat · Collaboration · Devops
Open core, self-hosted team collaboration with chat, AI agents, voice calling, and deep DevOps integrations — all under your control.
Notesnook
Note Taking · File Storage · Security
End-to-end encrypted, open-source note-taking where your data stays yours — even from the server.
Onlook
Design Tools · AI Design Tools
An open-source, AI-first visual editor that lets designers and developers build, style, and deploy React apps directly in code — no handoff required.