argufy
![npm version](https://badge.fury.io/js/argufy.svg)
yarn add -E argufy
argufy
will parse command line arguments to Node.js CLI programs.
API
The package assumes that the arguments begin from the 3rd position, i.e.,
node example.js --title "Hello World"
argufy(config, argv):object
The flags from the arguments will be extracted according to the configuration object.
import argufy from 'argufy'
const config = {
title: { short: 't', command: true },
list: { short: 'l', boolean: true },
app: 'a',
delay: 'y',
file: 'f',
wait: { short: 'w', number: true },
'no-empty': 'e',
resize: 'z',
colors: 'c',
dir: 'D',
}
const res = argufy(config, process.argv)
console.log(res)
node example.js --title "Hello World" -w 10 -l -app Argufy
node example.js "Hello World" -w 10 -l -app Argufy
{ title: 'Hello World', list: true, app: 'Argufy', wait: 10 }
(c) artdecocode 2018