@simon_he/qargs
v0.0.5
Published
Help you quickly process argv
Downloads
1
Readme
@simon_he/qargs
Help you quickly process argv
Install
npm i @simon_he/qargs
Usage
import { getArgs } from '@simon_he/qargs'
const args = getArgs()
// run --help
args.has('help') // true
// run --username simon_he
args.get('username') // simon_he
// run --username simon_he --password 123456
args.get(['username','password']) // [simon_he,123456]
// run find
args.hasCommand('find') // true
Options
{
args: string[];
rawArgs: string;
options: Options[];
commanders: string[];
has: (key: string) => boolean;
get: (key: string | string[]) => string | boolean | (string | boolean | undefined)[] | undefined;
hasCommand: (key: string) => boolean;
}