args-and-flags
v3.0.3
Published
parse and validate args and flags for commandline tools
Downloads
17
Readme
args-and-flags
An argument parser based on minimist that offers named arguments, flags, validation, and default or required values.
Install
npm install --save args-and-flags
Node v8 and higher is required
Usage
import ArgsAndFlags from 'args-and-flags'
const options = {
args: [
{
name: 'hello',
type: 'string',
help: 'an argument for saying hello'
}
],
flags: [
{
name: 'message',
alias: 'm',
type: 'boolean',
help: 'a boolean argument'
}
]
}
const parser = new ArgsAndFlags(options)
const { args, flags } = parser.parse(['hi', '-m'])
Documentation
Examples
Contributing
Contributions are welcome! Please read the contributing guidelines first.
Conduct
Help keep this project open and inclusive. Read and follow our Code of Conduct.
Change log
Read about the changes to this project in CHANGELOG.md. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Contact
- issues – Please open issues in the issues queue