# indexed-kv

> Using an indexedDB as a KV

Latest version **0.1.4** (published 2020-02-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install indexed-kv
pnpm add indexed-kv
yarn add indexed-kv
bun add indexed-kv
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2020-02-29 |
| First published | 2020-02-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | tkdalic |
| Maintainers | tukumo |

## Links

- npm: https://www.npmjs.com/package/indexed-kv
- Repository: https://github.com/tkdalic/indexed-kv
- Homepage: https://github.com/tkdalic/indexed-kv#indexed-kv
- npm.io page: https://npm.io/package/indexed-kv

## Recent versions

- 0.1.4 (latest) — 2020-02-29
- 0.1.3 — 2020-02-29
- 0.1.2 — 2020-02-29
- 0.1.1 — 2020-02-29
- 0.1.0 — 2020-02-29

## README

# indexed-kv

Using an indexedDB as a KV

npm: https://www.npmjs.com/package/indexed-kv

## 概要

indexed KV は、indexedDB を Key Value Store のように扱うライブラリです。

## API

### `new IndexedKv(dbName: string = "indexed_db", tableName: string = "kvs")`

IndexedKv の初期化関数。
IndexedDB における database の名前とテーブルの名前を指定する。

### `set(key: string, value: string): Promise<void>`

IndexedDB に、key と value の組み合わせで登録する。

### `get(key: string): Promise<string>`

IndexedDB から、key に対応する value を取得する。

## sample

以下の URL でサンプルが確認できます

https://tkdalic.github.io/indexed-kv

### 最小構成

```typescript
import { IndexedKv } from "indexed-kv";
const inputKey = "test";
const inputValue = "testValue";

const indexedKV = new IndexedKv(); // オブジェクトの作成
indexedKV
  .set(inputKey, inputValue) // keyとvalueのセットを登録
  .then(() =>
    indexedKV.get(inputValue).then(
      value => console.log(value) // "testValue"
    )
  );
```

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