@simon_he/qargs
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

@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

Buy Me A Coffee

sponsors

Readme

Keywords

none

Package Sidebar

Install

npm i @simon_he/qargs

Weekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

6.23 kB

Total Files

6

Last publish

Collaborators

  • simon_he