localForage

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

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

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
48 /100 Fair
Development Activity 0
Maintenance 20
Community 72
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
76 /100 Good
Architecture 78
Code Quality 72
Innovation 65
Learning Curve 90

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 16 apps in this directory

TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

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

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 3 weeks ago
Vue
43%
MIT

Alexandrie

Collaboration · Knowledge Management · Note Taking

2,777

The open-source, offline-first Notion, Obsidian & Confluence alternative with multi-tenant teams, OIDC/SSO, and one-command Docker deployment.

View details
86
Repo Health
73
Technical
74
Dependency
Built with
Vue 43%
TypeScript 41%
Go 13%
Updated 1 weeks ago
TypeScript
68%
Apache 2.0

Appsmith

Automation · Developer Tools · No Code Platforms

40,959

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

View details
93
Repo Health
79
Technical
66
Dependency
Built with
TypeScript 68%
Java 21%
Updated 6 days ago
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,650

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

View details
67
Repo Health
76
Technical
62
Dependency
Built with
JavaScript 90%
Updated 3 weeks ago
TypeScript
88%
MIT

Drawnix

Design Tools · Productivity

14,848

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

View details
65
Repo Health
69
Technical
79
Dependency
Built with
TypeScript 88%
Updated 3 weeks ago
TypeScript
71%
Other

highlight.io

Analytics · Developer Tools · Monitoring

9,378

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
67
Repo Health
78
Technical
65
Dependency
Built with
TypeScript 71%
Go 16%
Updated 1 months ago
Rust
52%
Other

hoodik

File Storage · Security

1,484

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

View details
79
Repo Health
71
Technical
63
Dependency
Built with
Rust 52%
TypeScript 33%
Vue 14%
Updated 1 weeks ago
TypeScript
51%
Other

Mattermost

Collaboration · Devops · Team Chat

39,203

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
65
Dependency
Built with
TypeScript 51%
Go 40%
Updated 4 days ago
TypeScript
85%
GPL 3.0

Notesnook

File Storage · Note Taking · Security

14,660

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

View details
90
Repo Health
84
Technical
60
Dependency
Built with
TypeScript 85%
JavaScript 12%
Updated 5 days 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