Esta página ainda não está disponível em Português, por isso está a ler a versão em inglês.

idb

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

★ Escolha do PWA.live: é por onde começarí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.