# cloudflare-kv-storage-rest

> Tiny javascript and node wrapper for the cloudflare kv-storage rest-api

Latest version **1.1.1** (published 2021-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install cloudflare-kv-storage-rest
pnpm add cloudflare-kv-storage-rest
yarn add cloudflare-kv-storage-rest
bun add cloudflare-kv-storage-rest
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2021-04-24 |
| First published | 2020-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Markus Ahlstrand |
| Maintainers | markusahlstrand |
| Keywords | cloudflare, kv-storage |

## Links

- npm: https://www.npmjs.com/package/cloudflare-kv-storage-rest
- Repository: https://github.com/markusahlstrand/cloudflare-kv-storage-rest
- Homepage: https://github.com/markusahlstrand/cloudflare-kv-storage-rest#readme
- Issues: https://github.com/markusahlstrand/cloudflare-kv-storage-rest/issues
- npm.io page: https://npm.io/package/cloudflare-kv-storage-rest

## Dependencies (2)

- [lodash.get](https://npm.io/package/lodash.get.md) 4.4.2
- [fetch-retry](https://npm.io/package/fetch-retry.md) 4.1.1

## 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

- 1.1.1 (latest) — 2021-04-24
- 1.1.0 — 2021-04-20
- 1.0.2 — 2021-02-17
- 1.0.1 — 2020-08-06
- 1.0.0 — 2020-07-13
- 0.1.1 — 2020-07-13
- 0.1.0 — 2020-07-11

## README

# cloudflare-kv-storage-rest

Tiny javascript and node wrapper for the cloudflare kv-storage rest-api.

There are a few api-wrappers available on github but so far I haven't found any that supports the new metadata functionality.

The idea with library is to create a wrapper around the the rest api that works exactly as the runtime API (https://developers.cloudflare.com/workers/reference/apis/kv)

## Usage in browser

Create an instance of Kv-Storage. The instance will expose the same api as the variable in the runtime API.

## Usage in nodejs

To use this is nodejs you can add node-fetch and form-data to the global context:

```
global.fetch = require('node-fetch');
global.FormData = require('form-data');
```

Another options is to pass the fetch and form-data shims to the constructor

```
const fetch = require('node-fetch');
const FormData = require('form-data');

const kvStorage = new KvStorage({
    namespace: 'namespace',
    accountId: 'accountId',
    fetch,
    FormData,
});
```

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