ucmd
v0.4.8
Published
µCMD is a minimal and strictly typed argument parsing library for node.js
Downloads
21
Readme
µCMD
minimal and strictly typed argument parsing for node.js 19+
Installation
$ npm i ucmd
# or
$ yarn add ucmd
# or
$ pnpm add ucmd
Usage
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();