# parseCmdArgs(args, options, options.requireUserInput)
Returns an object containing the path and flags parsed from process.argv console.log(parseCmdArgs()); console.log(parseCmdArgs(process.argv.slice(2))); console.log(parseCmdArgs(['--version'])); console.log(parseCmdArgs(['-s', 'Test email'])); console.log(parseCmdArgs(['./src/', '-s', 'Test email'])); console.log(parseCmdArgs(null, {'requireUserInput': true}));
Parameters
Name | Types | Description |
---|---|---|
args | array |
Arguments to parse through. |
options | object |
Options object. |
options.requireUserInput | boolean |
Require user defined input through process.argv removing default of current directory. |
Returns
object
Object with keys for both the input and flags parsed out of arguments array.