Skip to content

keepwondering/pleasure-args-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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]

Releases

No releases published

Packages

No packages published