Esta página aún no está disponible en Español, así que estás leyendo la versión en inglés.

idb

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

★ Elegido por PWA.live: por aquí empezaríamos.

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.