KVNamespace
Source:
src/Cloudflare/KV/KVNamespace.ts
A Cloudflare Workers KV namespace for key-value storage at the edge.
KV provides eventually-consistent, low-latency reads with global replication. Create a namespace as a resource, then bind it to a Worker to get/put values at runtime.
Creating a Namespace
Section titled “Creating a Namespace”const kv = yield* Cloudflare.KVNamespace("MyKV");Binding to a Worker
Section titled “Binding to a Worker”const kv = yield* Cloudflare.KVNamespace.bind(MyKV);
// Read a valueconst value = yield* kv.get("my-key");
// Write a valueyield* kv.put("my-key", "hello world");