# @kvs/indexeddb

> IndexedDB for KVS

Latest version **2.2.2** (published 2026-01-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kvs/indexeddb
pnpm add @kvs/indexeddb
yarn add @kvs/indexeddb
bun add @kvs/indexeddb
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.2.2 |
| Published | 2026-01-18 |
| First published | 2020-08-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 41.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 190 |
| Author | azu |
| Maintainers | azu |
| Keywords | kvs, indexed, storage, key-value |

## Links

- npm: https://www.npmjs.com/package/@kvs/indexeddb
- Repository: https://github.com/azu/kvs
- Homepage: https://github.com/azu/kvs/tree/master/packages/indexeddb/
- Issues: https://github.com/azu/kvs/issues
- npm.io page: https://npm.io/package/@kvs/indexeddb

## Dependencies (2)

- [@kvs/types](https://npm.io/package/@kvs/types.md) ^2.2.2
- [@kvs/storage](https://npm.io/package/@kvs/storage.md) ^2.2.2

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 2.2.2 (latest) — 2026-01-18
- 2.2.1 — 2026-01-18
- 2.1.4 — 2023-07-21
- 2.1.3 — 2022-09-25
- 2.1.1 — 2022-03-03
- 2.1.0 — 2022-03-02
- 2.0.0 — 2022-02-19
- 1.2.0 — 2021-04-17
- 1.1.0 — 2020-10-29
- 1.0.0 — 2020-08-22
- 0.3.1 — 2020-08-22
- 0.3.0 — 2020-08-22
- 0.2.1 — 2020-08-22
- 0.2.0 — 2020-08-08
- 0.1.0 — 2020-08-08

## README

# @kvs/indexeddb ![](https://badgen.net/bundlephobia/minzip/@kvs/indexeddb)

IndexedDB for KVS

## Install

Install with [npm](https://www.npmjs.com/):

    npm install @kvs/indexeddb

## Usage

```ts
import { KVSIndexedDB, kvsIndexedDB } from "@kvs/indexeddb";
(async () => {
    type StorageSchema = {
        a1: string;
        b2: number;
        c3: boolean;
    };
    const storage = await kvsIndexedDB<StorageSchema>({
        name: "test",
        version: 1,
    });
    await storage.set("a1", "string");
    await storage.set("b2", 42);
    await storage.set("c3", false);
    const a1 = await storage.get("a1");
    const b2 = await storage.get("b2");
    const c3 = await storage.get("c3");
    assert.strictEqual(a1, "string");
    assert.strictEqual(b2, 42);
    assert.strictEqual(c3, false);
})();
```

## Changelog

See [Releases page](https://github.com/azu/kvs/releases).

## Running tests

Install devDependencies and Run `npm test`:

    npm test

## Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, [please create an issue](https://github.com/azu/kvs/issues).

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## Author

- [github/azu](https://github.com/azu)
- [twitter/azu_re](https://twitter.com/azu_re)

## License

MIT © azu

## Related

- https://github.com/tkdalic/indexed-kv
- https://github.com/GoogleChromeLabs/kv-storage-polyfill
- https://github.com/localForage/localForage/blob/master/src/drivers/indexeddb.js

---
_Source: https://npm.io/package/@kvs/indexeddb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
