OSS Tanbou

recreate the IndexedDB API in memory for Node.js tests

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
695
Primary language
JavaScript
License
Apache-2.0
Repository last updated
May 13, 2026
On this page

Overview

fake-indexeddb is a pure JavaScript in-memory implementation of the IndexedDB API for running IndexedDB-dependent code in Node.js tests. It can install IndexedDB globals through fake-indexeddb/auto or expose individual objects for explicit dependency injection.

Features and best fit

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

Key features

Bring IndexedDB APIs into Node.js tests

It provides core objects such as indexedDB and IDBKeyRange in memory, allowing application data-access code to exercise database creation, object stores, indexes, cursors, and related IndexedDB flows outside a browser.

Sources: [2]

Choose global setup or explicit imports

The shortest setup imports fake-indexeddb/auto to register IndexedDB globals. Tests that avoid global mutation can instead import objects such as indexedDB and IDBKeyRange and pass them explicitly to wrappers such as Dexie.

Sources: [2]

Best fit

Fits unit and integration tests for IndexedDB-backed frontends

It is useful when IndexedDB-dependent application code needs to run under Node.js or Jest. The README also documents integration patterns for Dexie and similar IndexedDB wrappers.

Sources: [2]

Before adoption

Do not treat the in-memory implementation as full browser fidelity

Data is not persisted to disk and the implementation is not a browser engine. Features that depend on browser-specific behavior, persistence, quotas, or multi-tab coordination should still be validated in real browsers.

Sources: [2]

Check structuredClone support in jsdom environments

Since v5, fake-indexeddb no longer bundles a structuredClone polyfill. Older runtimes or some jsdom setups may require one of the workarounds documented in the README.

Sources: [2]

Official sources

  1. [1]dumbmatter/fakeIndexedDB repository(2026-09-30)
  2. [2]fake-indexeddb README(2026-09-30)
  3. [3]fake-indexeddb Apache-2.0 license(2026-09-30)
Supplemental curator note

It can make data-layer tests fast and deterministic under Node.js, but it is not a substitute for browser tests that depend on persistence, quotas, or browser-specific behavior.

Try it in 3 steps

  1. 1

    Add fake-indexeddb as a development dependency

    Install fake-indexeddb into the Node.js test environment using the command documented in the README.

    npm install --save-dev fake-indexeddb
  2. 2

    Register IndexedDB APIs for the test environment

    Import the automatic setup in the test or shared setup file to expose globals such as indexedDB.

    import "fake-indexeddb/auto";
  3. 3

    Open a test database

    Use the same IndexedDB API as the application to exercise object stores and reads/writes. The in-memory data is not persisted to disk.

    const request = indexedDB.open("test", 1);
Check the official README

Growth

Growth trends · Last 30 days

695 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
0
Open PRs
0

Development activity is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • indexeddb
  • ponyfill
  • shim
  • polyfill
Stars
695
Forks
79
Watchers
8
Open issues
7
Contributors
16
Owner type
User
Primary language
JavaScript
License
Apache-2.0
Repository last updated
May 13, 2026
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?