@miniflare/cli-parser
v2.14.4
Published
CLI option parsing module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers
Downloads
237,750
Maintainers
Readme
@miniflare/cli-parser
CLI option parsing module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers. See 💻 Using the CLI for more details.
Example
import { buildHelp, parseArgv } from "@miniflare/cli-parser";
import { BuildPlugin } from "@miniflare/core";
import { KVPlugin } from "@miniflare/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 };