UNPKG

node-arg-parser

Version:

A simple, chainable command-line argument parser for Node.js CLI tools. Supports type validation, short & long args, and automatic help display.

33 lines (31 loc) 795 B
declare module "node-arg-parser" { // Adjust the declaration to match the actual API of node-arg-parser export default class ArgParser { constructor(); /** * Defines a new argument. * @param shortArg - e.g., "-f" * @param longArg - e.g., "--file" */ add(shortArg: string, longArg: string): { /** * Set the expected type: String, Number, or Boolean. */ acceptType(type: any): { /** * Set the description for the argument. */ setDescription(description: string): { /** * Specify if the argument is required. */ required(isRequired?: boolean): void; }; }; }; /** * Parses the command line arguments. */ parse(): any; } }