@d1testflare/cli-parser
TypeScript icon, indicating that this package has built-in type declarations

2.9.0 • Public • Published

@d1testflare/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 "@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 };

Package Sidebar

Install

npm i @d1testflare/cli-parser

Weekly Downloads

1

Version

2.9.0

License

MIT

Unpacked Size

23.5 kB

Total Files

5

Last publish

Collaborators

  • oconnorct1