MVFM

cloudflare-kv

Implementation of Cloudflare KV operations. There is no default interpreter because KV requires a configured namespace.

The playground uses an in-memory KV mock to keep examples deterministic and side-effect free.

import { cloudflareKv, createCloudflareKvInterpreter, wrapKVNamespace } from "@mvfm/plugin-cloudflare-kv";

// 1. Wrap a Cloudflare Workers KV namespace
const client = wrapKVNamespace(env.MY_KV_NAMESPACE);

// 2. Build the interpreter
const kvInterp = createCloudflareKvInterpreter(client);

// 3. Merge and run
const app = mvfm(prelude, cloudflareKv);
const baseInterp = defaults(app);
await fold(
  { ...baseInterp, ...kvInterp },
  prog
);