process-yargs-parser
Lightweight Node.js arguments parser with 0 Dependencies
π .process-yargs-parser is an opinionated yargs-parser with many needless yargs-parser configurations disabled by default.
Example
npm i process-yargs-parser --save
const argv = require('process-yargs-parser')(process.argv.slice(2))
console.log(argv)
node ./example.js --foo=33 --bar hello
{ _: [], foo: 33, bar: 'hello' }
or parse a string!
const argv = require('process-yargs-parser')('--foo=99 --bar=33')
console.log(argv)
{ _: [], foo: 99, bar: 33 }
READ more usages in index.test.js.
Features
- [x] duplicate-arguments-array: default false
- [x] short-option-groups: default false
- [x] boolean-negation: default false
- [x] no-convert-number-string default false. will convert "1" to 1