Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jacoblincool/worker-gist

GitHub Gist as KV, for Cloudflare Workers. It helps to keep the number of KV write operation as low as possible.
https://github.com/jacoblincool/worker-gist

cloudflare gist github workers workers-kv

Last synced: 22 days ago
JSON representation

GitHub Gist as KV, for Cloudflare Workers. It helps to keep the number of KV write operation as low as possible.

Awesome Lists containing this project

README

        

# Worker Gist

GitHub Gist as KV, for Cloudflare Workers.

It is slower than KV, but it helps to keep the number of KV `write` operation as low as possible.

## Usage

```ts
import { GistStore } from "worker-gist";

const store = new GistStore(env.KV, env.PAT);

const logs = JSON.parse((await store.get("logs")) || "[]");

logs.push({ time: Date.now(), msg: "Something to log." });

await store.set("logs", JSON.stringify(logs));
```