Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@kvs/indexeddb

azu61.8kMIT2.1.4TypeScript support: included

IndexedDB for KVS

kvs, indexed, storage, key-value

readme

@kvs/indexeddb

IndexedDB for KVS

Install

Install with npm:

npm install @kvs/indexeddb

Usage

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.

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.

  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

License

MIT © azu

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

2.1.3 (2022-09-25)

Bug Fixes

2.1.2 (2022-08-21)

Bug Fixes

  • kvs/env: module entry point to browser (b8529ad)

2.1.1 (2022-03-03)

Note: Version bump only for package root

2.1.0 (2022-03-02)

Bug Fixes

  • indexeddb: remove "debug" option (#25) (606b9a2)

Performance Improvements

2.0.0 (2022-02-19)

Bug Fixes

BREAKING CHANGES

  • storage: storage package sperate storags by name option

Affected Packages

  • @kvs/env in Node.js
    • 📝 Browser is not affected because it uses IndexedDB
  • @kvs/storage
  • @kvs/localstorage
  • @kvs/memorystorage
  • @kvs/node-localstorage
  • @kvs/storage-sync

1.2.0 (2021-04-17)

Features

  • types: Use Key Remapping in Mapped Types. (#17) (7c099be)

BREAKING CHANGES

  • types: require TypeScript 4.1+

It aims to support to following schema:

const storage = kvs<{
    [index: string]: string;
}>;

1.1.0 (2020-10-29)

Features

1.0.0 (2020-08-22)

Note: Version bump only for package kvs

0.3.1 (2020-08-22)

Note: Version bump only for package kvs

0.3.0 (2020-08-22)

Features

  • storage-sync: add storage-sync package (#11) (5748776)

0.2.1 (2020-08-22)

Note: Version bump only for package kvs

0.2.0 (2020-08-08)

Features

  • @kvs/env: migrate Schema Type (0951d08)
  • @kvs/indexeddb: migrate Schema Type (ec143e2)
  • @kvs/localstorage: migrate to Schema type (0c84640)
  • @kvs/memorystorage: migrate to Schema type (84d75f4)
  • storage: use Schema interface (2560aae)

0.1.0 (2020-08-08)

Bug Fixes

Features

  • @kvs/localstorage: add localstorage implementation (54fc38b)
  • @kvs/memorystorage: add in memory implementation (553247b)
  • @kvs/node-localstorage: add node implementation (5160012)
  • @lvs/env: add universal env (36eef88)
  • add close() to interface (a269d1d)
  • add debug options (75a083e)
  • kvs/indexeddb: add [Symbol.asyncIterator] (68392d4)
  • kvs/indexeddb: add dropInstance (0a38a0c)
  • kvs/indexeddb: implement basic usage (cc14444)