finds.dev← search

// the find

jakearchibald/idb-keyval

★ 3,200 · TypeScript · NOASSERTION · updated Jun 2026

A super-simple-small promise-based keyval store implemented with IndexedDB

idb-keyval is a minimal IndexedDB wrapper that gives you a promise-based get/set/del API in under 600 bytes. It's by Jake Archibald (Chrome team), so it's not a random npm package — he knows the IDB spec intimately. Aimed at anyone who needs persistent browser storage and doesn't want localStorage's synchronous, string-only limitations.

Tree-shaking works properly — if you only import get/set, you pay 295 bytes brotli'd, not the whole library. The update() method handles the read-modify-write race condition that trips up most people using IDB directly. Structured-clone support means you can store Blobs, ArrayBuffers, and complex objects without serialization gymnastics. Actively maintained — last push was five days ago.

No offline queue or retry logic if IDB is unavailable (Safari private mode used to throw, some WebViews still behave oddly). No observability — there's no way to subscribe to changes across tabs without wiring up BroadcastChannel yourself. The bulk operations (setMany, getMany) share one transaction, which is good, but there's no way to batch operations across different stores atomically. If you ever outgrow keyval semantics and need indexes or cursors, you're migrating off rather than upgrading — the library has no migration path by design.

View on GitHub →

// 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 →