ucmd
TypeScript icon, indicating that this package has built-in type declarations

0.4.8 • Public • Published

µCMD API Docs

minimal and strictly typed argument parsing for node.js 19+

Installation

$ npm i ucmd
# or
$ yarn add ucmd
# or
$ pnpm add ucmd

Usage

TypeScript
import { ucmd, Command } from "ucmd";

const buildCommand = {
  name: "build",
  run: (ctx) => console.log(ctx.args, ctx.positionals),
  args: {
    config: {
      type: "string",
      short: "c",
    },
  },
} satisfies Command;

ucmd("scripts")
  .withCommand({
    name: "test",
    run: (ctx) => console.log(ctx.args, ctx.positionals),
  })
  .withCommand(buildCommand)
  .run();

Readme

Keywords

Package Sidebar

Install

npm i ucmd

Weekly Downloads

18

Version

0.4.8

License

MIT

Unpacked Size

67.8 kB

Total Files

16

Last publish

Collaborators

  • explodingcamera