Skip to content

dkh-dev/parse-argv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
      }
*/