
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@oclif/parser
Advanced tools
This library has been replaced by @oclif/core and is now in maintenance mode. We will only consider PRs that address security concerns.
arg and flag parser for oclif
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
Yargs is a popular command-line argument parser that provides a rich set of features for parsing arguments, flags, and options. It offers a more extensive API compared to @oclif/parser and is widely used in the Node.js community.
Commander is another widely-used command-line argument parser that provides a simple and intuitive API for defining commands, arguments, and options. It is known for its ease of use and flexibility, making it a good alternative to @oclif/parser.
Minimist is a lightweight command-line argument parser that focuses on simplicity and minimalism. It is suitable for projects that require basic argument parsing without the overhead of more feature-rich libraries like @oclif/parser.
FAQs
arg and flag parser for oclif
We found that @oclif/parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.