localForage

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

Library
npm
v1.10.0
25,804 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
99%
Apache 2.0

Onlook

AI Design Tools · Design Tools

26,996

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
63
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 99%
Updated 1 weeks ago
JavaScript
50%
AGPL 3.0

QRev

AI Agents · CRM

364

Open source AI-first sales platform that replaces Salesforce with autonomous agents handling prospecting, outreach, and lead management at scale.

View details
39
Repo Health
68
Technical
64
Dependency
Built with
JavaScript 50%
Python 28%
TypeScript 14%
Updated 8 months ago
TypeScript
99%
MIT

React Cosmos

Developer Tools

8,690

An open-source sandbox for developing and testing React and React Native UI components in isolation, with pluggable bundler support for Vite and Webpack.

View details
76
Repo Health
69
Technical
73
Dependency
Built with
TypeScript 99%
Updated 1 weeks ago
TypeScript
97%
Other

Rocket.Chat

Team Chat

46,304

The secure, self-hosted team communications platform for organizations that cannot compromise on data sovereignty.

View details
96
Repo Health
79
Technical
63
Dependency
Built with
TypeScript 97%
Updated 6 days ago
JavaScript
89%
GPL 3.0

Screenity

Productivity · Video Editors

18,806

Free, privacy-first Chrome screen recorder with real-time annotation, AI camera blur, and a built-in video editor — no sign-in or limits required.

View details
74
Repo Health
62
Technical
70
Dependency
Built with
JavaScript 89%
Updated 1 weeks ago
JavaScript
86%
AGPL 3.0

SillyTavern

AI Assistants

34,869

The power-user LLM frontend that unifies dozens of AI backends with a rich scripting engine, immersive Visual Novel mode, and a thriving extension ecosystem.

View details
88
Repo Health
71
Technical
63
Dependency
Built with
JavaScript 86%
Updated 4 weeks ago
JavaScript
74%
AGPL 3.0

Twake Drive

Collaboration · File Storage

989

Open-source, self-hosted file manager with collaborative drives, AI-powered summarization, and OnlyOffice document editing for teams who want full data sovereignty.

View details
91
Repo Health
78
Technical
71
Dependency
Built with
JavaScript 74%
TypeScript 25%
Updated 1 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