This contains convenience methods for accessing commandline arguments.
npm install vamtiger-argvbash
npm i --save vamtiger-argv
`
or
`bash
yarn add vamtiger-argv
`Usage
Import or require a referece to VAMTIGER Argv:
`javascript
import Args = require('vamtiger-argv');
`
or
`javascript
const Args = require('vamtiger-argv');
`Any Node.js script can be executed with commandline arguments.
`bash
node someNodeProgram.js --someArgument someValue --anotherArg anotherValue1 --anotherArg anotherValue2
`Commandline arguments can then be referenced by name using the _get_ _method_.
`javascript
const args = new Args();args.get('someArgument'); // someValue
args.getAll('anotherArg'); // ['anotherValue1', 'anotherValue2']
`The first argument be referenced by using the __first__ _method_.
`javascript
argv.first(); // --someArgument
`Raw commandline arguments can also be referenced by using the _next_ _method_.
`javascript
args.next('--someArgument'); // someValue
`The _has_ _method_ can be used to check whether a commandline arguments is present.
`javascript
args.has('someArgument'); // true
args.has('--someArgument'); // true
args.has('someValue'); // true
args.has('someOtherArgument'); // false
``