zod-args
v0.1.0
Published
Zod-based argument parser.
Readme
zod-args
zod-args is the fastest way to throw together a simple CLI with TypeScript type checking. It uses zod for type inference and runtime validation.
Supported Zod features
stringnumberbooleanoptionaldefault
Getting started
npm install zod-argsExample
import { parseArgs } from "zod-args";
const args = parseArgs({
name: z.string(),
age: z.number().optional().default(1),
});
console.log(`Hello ${args.name}! You are ${args.age} years old.`);