finds.dev← search

// the find

jakearchibald/idb

★ 7,366 · TypeScript · ISC · updated May 2025

IndexedDB, but with promises

A thin wrapper around the browser's IndexedDB API that replaces its event-based callbacks with promises and async/await. Written by Jake Archibald (formerly on the Chrome team), so it has real authority behind it. If you need structured client-side storage beyond a simple key-value store, this is the library to reach for first.

1.19kB brotli'd is genuinely tiny for what it does — you're not paying much to avoid the raw IndexedDB API. The TypeScript DBSchema typing is well thought out: store names, value types, and index types all flow through, so typos in store names become compile errors instead of silent runtime failures. The `tx.done` promise and the transaction lifetime warning in the docs show real awareness of the footgun that kills most hand-rolled IndexedDB code. The `wrap`/`unwrap` escape hatches are a practical acknowledgment that you'll eventually encounter a third-party IDB object you didn't open.

Testing requires a real browser — there's no Node-compatible test path, so anything using this in a shared codebase (SSR, service workers tested in Node) hits an immediate wall. The async iterator import path (`idb/with-async-ittr.js`) is a non-obvious split that will confuse anyone who doesn't read the docs carefully, especially since tree-shaking makes it seem unnecessary. No built-in migration helpers beyond the raw `upgrade` callback; you have to track `oldVersion` yourself, which gets messy past version 3 or 4. Activity has slowed significantly — the last meaningful release was in 2023 and most recent commits are maintenance-level.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →