localForage

Offline browser storage library with a simple localStorage-like API backed by IndexedDB or WebSQL.

Library
npm
v1.10.0
25,803stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
48/100Fair
Development Activity0
Maintenance20
Community72
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
76/100Good
Architecture78
Code Quality72
Innovation65
Learning Curve90

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/await or 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

TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
TypeScript
66%
Apache 2.0

Appsmith

Developer Tools · Automation · No Code Platforms

40,707

Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.

View details
94
Repo Health
79
Technical
68
Dependency
Built with
TypeScript66%
Java22%
Updated today
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,633

Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.

View details
65
Repo Health
76
Technical
63
Dependency
Built with
JavaScript90%
Updated 1 months ago
TypeScript
88%
MIT

Drawnix

Design Tools · Productivity

14,567

All-in-one open-source whiteboard combining mind maps, flowcharts, and freehand drawing on a single infinite canvas.

View details
73
Repo Health
69
Technical
83
Dependency
Built with
TypeScript88%
SCSS10%
Updated 3 days ago
TypeScript
71%
Other

highlight.io

Developer Tools · Analytics · Monitoring

9,367

Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.

View details
69
Repo Health
78
Technical
66
Dependency
Built with
TypeScript71%
Go16%
Updated yesterday
Rust
50%
Other

hoodik

File Storage · Security

1,446

Self-hosted, end-to-end encrypted cloud storage with browser-based encryption and S3-compatible storage support

View details
74
Repo Health
71
Technical
65
Dependency
Built with
Rust50%
TypeScript33%
Vue15%
Updated 4 days ago
TypeScript
51%
Other

Mattermost

Team Chat · Collaboration · Devops

38,838

Open core, self-hosted team collaboration with chat, AI agents, voice calling, and deep DevOps integrations — all under your control.

View details
96
Repo Health
87
Technical
66
Dependency
Built with
TypeScript51%
Go40%
Updated today
TypeScript
85%
GPL 3.0

Notesnook

Note Taking · File Storage · Security

14,433

End-to-end encrypted, open-source note-taking where your data stays yours — even from the server.

View details
91
Repo Health
84
Technical
66
Dependency
Built with
TypeScript85%
JavaScript12%
Updated today
TypeScript
99%
Apache 2.0

Onlook

Design Tools · AI Design Tools

26,512

An open-source, AI-first visual editor that lets designers and developers build, style, and deploy React apps directly in code — no handoff required.

View details
66
Repo Health
80
Technical
68
Dependency
Built with
TypeScript99%
Updated 4 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search