An argument parser based on minimist that offers named arguments, flags, validation, and default or required values.
npm install --save args-and-flags
Node v8 and higher is required
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'])
Contributions are welcome! Please read the contributing guidelines first.
Help keep this project open and inclusive. Read and follow our Code of Conduct.
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.
- issues – Please open issues in the issues queue