Skip to content

legend80s/process-yargs-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

36 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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.

npm version npm downloads install size jest passed coverage commit msg linted by git-commit-msg-linter

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

  • duplicate-arguments-array: default false
  • short-option-groups: default false
  • boolean-negation: default false
  • no-convert-number-string default false. will convert "1" to 1

About

Lightweight Node.js Arguments Parser with 0 Dependencies ๐Ÿš€ and with many needless yargs-parser configurations disabled by default.

Resources

License

Stars

Watchers

Forks

Packages

No packages published