@oclif/parser

arg and flag parser for oclif

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
2322Jun 8, 2021Jan 14, 2018Minified + gzip package size for @oclif/parser in KB

Readme

@oclif/parser

arg and flag parser for oclif

Version CircleCI Appveyor CI Codecov Known Vulnerabilities Downloads/week License

CLI flag parser.

Usage:

const CLI = require('cli-flags')

const {flags, args} = CLI.parse({
  flags: {
    'output-file': CLI.flags.string({char: 'o'}),
    force: CLI.flags.boolean({char: 'f'})
  },
  args: [
    {name: 'input', required: true}
  ]
})

if (flags.force) {
  console.log('--force was set')
}

if (flags['output-file']) {
  console.log(`output file is: ${flags['output-file']}`)
}

console.log(`input arg: ${args.input}`)

// $ node example.js -f myinput --output-file=myexample.txt
// --force was set
// output file is: myexample.txt
// input arg: myinput

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.