@d1testflare/cli-parser
CLI option parsing module for
Miniflare: a fun, full-featured,
fully-local simulator for Cloudflare Workers. See
Example
import { buildHelp, parseArgv } from "@d1testflare/cli-parser";
import { BuildPlugin } from "@d1testflare/core";
import { KVPlugin } from "@d1testflare/kv";
const plugins = { BuildPlugin, KVPlugin };
const help = buildHelp(plugins, "exec");
console.log(help); // Usage: exec ...
const options = parseArgv(plugins, [
"--build-command",
"npm run build",
"--kv-persist",
]);
console.log(options); // { buildCommand: "npm run build", kvPersist: true };