@dkh-dev/parse-argv

2.3.1 • Public • Published

@dkh-dev/parse-argv

Parse process arguments

Installation

$ yarn install @dkh-dev/parse-argv

Examples

parse-process-argv.ts

import parseArgv from '@dkh-dev/parse-argv';

console.log(parseArgv(process.argv.slice(2)));

// $ node test parse --a=b -b -c d e --e --f="g h" -i=123 -j=/k l/ -k false
/* => {
        '0': 'parse',
        '1': 'e',
        '2': 'l/',
        a: 'b',
        b: true,
        c: 'd',
        e: true,
        f: 'g h',
        i: 123,
        j: '/k',
        k: false
      }
*/

Dependents (1)

Package Sidebar

Install

npm i @dkh-dev/parse-argv

Weekly Downloads

19

Version

2.3.1

License

ISC

Unpacked Size

3.77 kB

Total Files

5

Last publish

Collaborators

  • dkh-dev