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

0.1.0 • Public • Published

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

  • string
  • number
  • boolean
  • optional
  • default

Getting started

npm install zod-args

Example

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.`);

Readme

Keywords

Package Sidebar

Install

npm i zod-args

Weekly Downloads

24

Version

0.1.0

License

MIT

Unpacked Size

27.5 kB

Total Files

12

Last publish

Collaborators

  • floydophone