# cache-blockstore

> An IPLD Blockstore on top of the browser CacheStorage API

Latest version **0.1.0** (published 2022-10-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install cache-blockstore
pnpm add cache-blockstore
yarn add cache-blockstore
bun add cache-blockstore
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2022-10-28 |
| First published | 2022-10-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 94.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | tchardin |
| Maintainers | tchardin |
| Keywords | IPFS, IPLD |

## Links

- npm: https://www.npmjs.com/package/cache-blockstore
- Repository: https://github.com/tchardin/cache-blockstore
- Homepage: https://github.com/tchardin/cache-blockstore#readme
- Issues: https://github.com/tchardin/cache-blockstore/issues
- npm.io page: https://npm.io/package/cache-blockstore

## Dependencies (4)

- [err-code](https://npm.io/package/err-code.md) ^3.0.1
- [multiformats](https://npm.io/package/multiformats.md) ^10.0.2
- [blockstore-core](https://npm.io/package/blockstore-core.md) ^2.0.2
- [interface-blockstore](https://npm.io/package/interface-blockstore.md) ^3.0.1

## Recent versions

- 0.1.0 (latest) — 2022-10-28

## README

# Cache Blockstore

> An IPLD Blockstore on top of the browser [CacheStorage](https://developer.mozilla.org/en-US/docs/Web/API/Cache) API

## Install

```sh
npm i cache-blockstore
```

## Usage

```ts
import {Cachestore} from "cache-blockstore";
import * as Block from 'multiformats/block'
import * as codec from '@ipld/dag-cbor'
import { sha256 as hasher } from 'multiformats/hashes/sha2'

const value = { hello: 'world' }

(async () => {
  const store = new Cachestore("/my-app/blocks");

  await store.open();

  // encode a block
  let block = await Block.encode({ value, codec, hasher })

  await store.put(block.cid, block.bytes);
}());
```

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