idb

A tiny wrapper that makes IndexedDB use promises, while keeping its full model (stores, indexes, transactions, cursors).

★ A PWA.live pick: where we would start.

A tiny wrapper that makes IndexedDB use promises, while keeping its full model (stores, indexes, transactions, cursors).

When to use it

You want IndexedDB without the callbacks, and no extra abstraction.

Get started

npm i idb
import { openDB } from 'idb';
const db = await openDB('app', 1, { upgrade(db) { db.createObjectStore('notes', { keyPath: 'id' }); } });
await db.put('notes', { id: 1, text: 'Hello' });

Source code, issues and documentation: github.com/jakearchibald/idb.