Kind: global function
Returns: Object
- The parsed args in object style
Param | Type | Default | Description |
---|---|---|---|
[args] | Array.<String> |
process.argv |
Arguments |
Example (Retrieving cli args)
const PleasureArgsParser = require('pleasure-args-parser')
const args = PleasureArgsParser(['--sandy=papo', '-papo', '--api', '--name', 'martin'])
console.log(typeof args === 'object') // true
console.log(args.sandy === 'papo') // true
console.log(args.api) // true
console.log(args.papo) // true
console.log(args.name === 'martin') // true
console.log(Object.keys(args).length === 4) // true
© 2019 Martin Rafael [email protected]