OSS TanbouSign in with GitHub

use IndexedDB and other browser persistence through an asynchronous localStorage-like API

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
25,809
Primary language
JavaScript
License
Apache-2.0
Repository last updated
Jul 30, 2024
On this page

Overview

localForage is a JavaScript storage library that exposes IndexedDB and WebSQL through an API similar to localStorage. It provides asynchronous Promise/callback methods and falls back to localStorage when the richer drivers are unavailable.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Run setItem and getItem asynchronously with Promises or callbacks

setItem(), getItem(), removeItem(), and related methods resemble localStorage while remaining asynchronous. Both Promises and Node-style callbacks are supported, and the README recommends Promises when there is no specific preference.

Sources: [1]

Store objects, Blobs, and TypedArrays in addition to strings

The API accepts JSON-serializable JavaScript objects plus ArrayBuffers, Blobs, and TypedArrays. When localStorage is the backend, localForage performs the required serialization and parsing.

Sources: [1]

Configure drivers and stores and separate multiple instances

config() controls driver, database name, store name, and related settings, while createInstance() creates independent stores within the same application.

Sources: [1]

Best fit

Fits offline data and client-side caches that need a small persistence API

It is useful when a web application wants Promise-based key-value persistence without spreading raw IndexedDB calls throughout UI code.

Sources: [1]

Before adoption

The runtime target is a browser environment

The README describes localForage as a browser library, and its project tests explicitly require a browser environment. Node.js or SSR-only code should not assume the same storage drivers are available.

Sources: [1]

Capacity and behavior vary with the selected fallback backend

When IndexedDB or WebSQL is unavailable, localForage falls back to localStorage. The README warns that localStorage limits make storing many large Blobs impractical, so storage volume and target-browser behavior need validation.

Sources: [1]

Official sources

  1. [1]localForage 1.10.0 README(2026-10-05)
  2. [2]localForage 1.10.0 package metadata(2026-10-05)
  3. [3]localForage 1.10.0 changelog(2026-10-05)
  4. [4]localForage 1.10.0 release(2026-10-05)
  5. [5]localForage Apache-2.0 license(2026-10-05)
Supplemental curator note

localForage is easy to evaluate when a web application wants IndexedDB-backed persistence without adopting the raw IndexedDB API everywhere. Storage limits and behavior vary by driver, and the project documentation explicitly treats a real browser environment as the runtime target.

Try it in 3 steps

  1. 1

    Install localForage 1.10.0 in an isolated project

    Pin the current package version in a temporary project for browser-storage verification.

    demo=$(mktemp -d "${TMPDIR:-/tmp}/localforage.XXXXXX") && cd "$demo" && npm init -y >/dev/null && npm install --save-exact localforage@1.10.0
  2. 2

    Create minimal HTML that stores, reads, and removes an object

    Use the Promise API to persist a JavaScript object, render the retrieved value, and then remove the demo data.

    printf "%s\n" '<!doctype html>' '<meta charset="utf-8">' '<script src="./node_modules/localforage/dist/localforage.js"></script>' '<script>' "(async () => {" " await localforage.setItem('oss-tanbou-demo', { ready: true });" " const value = await localforage.getItem('oss-tanbou-demo');" " document.body.textContent = JSON.stringify(value);" " await localforage.removeItem('oss-tanbou-demo');" "})();" '</script>' > index.html
  3. 3

    Open the HTML in a browser and verify async persistence

    Open index.html in a browser and confirm the page shows {"ready":true} while localForage selects an available browser storage driver.

    index.html
Check the official README

Growth

Growth trends · Last 30 days

25,809 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
0
Open PRs
35

Development activity is still being collected.

Built with

Categories and tags

Categories

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • localforage
  • localstorage
  • javascript
  • offline
  • storage
  • indexeddb
  • websql
Stars
25,809
Forks
1,288
Watchers
302
Open issues
215
Contributors
94
Owner type
Organization
Primary language
JavaScript
License
Apache-2.0
Repository last updated
Jul 30, 2024
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?