Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 834 Bytes

README.md

File metadata and controls

26 lines (20 loc) · 834 Bytes

PleasureArgsParser([args]) ⇒ Object

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]