0.0.5 • Published 2 years ago

@simon_he/qargs v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@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;
}

License

MIT License © 2022 Simon He

sponsors

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago