# @tatchi/bs-idb-keyval

> BuckleScript bindings for idb-keyval

Latest version **0.2.0** (published 2020-04-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tatchi/bs-idb-keyval
pnpm add @tatchi/bs-idb-keyval
yarn add @tatchi/bs-idb-keyval
bun add @tatchi/bs-idb-keyval
```

## 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.2.0 |
| Published | 2020-04-25 |
| First published | 2020-04-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Corentin Leruth |
| Maintainers | tatchi |
| Keywords | reason, bucklescript, idb-keyval, idb, indexeddb, localstorage, storage |

## Links

- npm: https://www.npmjs.com/package/@tatchi/bs-idb-keyval
- Repository: https://github.com/tatchi/bs-idb-keyval
- Homepage: https://github.com/tatchi/bs-idb-keyval#readme
- Issues: https://github.com/tatchi/bs-idb-keyval/issues
- npm.io page: https://npm.io/package/@tatchi/bs-idb-keyval

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2020-04-25
- 0.1.0 — 2020-04-12

## README

# bs-idb-keyval

[BuckleScript](https://github.com/bucklescript/bucklescript) bindings for [idb-keyval](https://github.com/jakearchibald/idb-keyval)

## Installation

```sh
npm install --save @tatchi/bs-idb-keyval
```

Then add `@tatchi/bs-idb-keyval` to `bs-dependencies` in your `bsconfig.json`:
```js
{
  ...
  "bs-dependencies": ["@tatchi/bs-idb-keyval"]
}
```

## Usage

### Create store:

```js
let store = IdbKeyVal.createStore("custom-db-name", "custom-store-name");
```

### set:

```js
IdbKeyVal.set("key", "value", store)
  |> Js.Promise.then_(() => {
       Js.log("It worked!");
       Js.Promise.resolve();
     })
  |> Js.Promise.catch(err => {
       Js.log2("It failed!!", err);
       Js.Promise.resolve();
     });
```

### get:

```js
IdbKeyVal.get("key", store)
|> Js.Promise.then_(value => {
     // logs: "value"
     Js.log(value);
     Js.Promise.resolve();
   });
```

### keys:

```js
IdbKeyVal.keys(store)
|> Js.Promise.then_(keys => {
     // logs: ["key"]
     Js.log(keys);
     Js.Promise.resolve();
   });
```

### delete:

```js
IdbKeyVal.delete("key", store)
|> Js.Promise.then_(keys => {
     Js.log("deleted");
     Js.Promise.resolve();
   });
```

### clear:

```js
IdbKeyVal.clear(store)
|> Js.Promise.then_(keys => {
     Js.log("cleared");
     Js.Promise.resolve();
   });
```

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