Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
inquander
Advanced tools
Readme
Inquirer for commander. This module takes two awesome modules and connects them.
If no arguments and options are passed to your commander app, it runs inquirer. For all commands, arguments and options defined in your commander app.
If you call your module with arguments it acts like a normal commander tool.
But if you call it without any arguments or commands it will parse your definitions and runs it using inquirer.
Instead of calling program.parse you need to call inquander.parse.
var program = require('commander'),
inquander = require('inquander');
program
.command('hello [name]')
.action(function(name) {
console.log('Hello', name);
});
program
.command('pay [creditcard]')
.action(function(creditcard) {
console.log('Please come again.');
console.log(creditcard);
});
inquander.parse(program, process.argv);
The root message and default command options define the inquirer root behavior:
inquander.parse(program, process.argv, {
message: 'Little Caesar\'s Pizza Ordering',
defaultCommand: 'pay'
});
The commander api doesn't identify special types (password, list, editor, etc). So to specify field types specifically for inquirer, use the overrides option:
inquander.parse(program, process.argv, {
overrides: {
'creditcard': {
type: 'password'
},
'pickup': {
type: 'checkbox',
choices: ['one', 'two']
}
}
});
To hide a field from the interactive view, use the hidden option:
inquander.parse(program, process.argv, {
hidden: ['notininquirer']
});
Inquander.runCommand(command, forceInteractive)
allows you to manually trigger a generated
command.
To enable different behavior for interactive and non-interactive modes,
inquander defines a flag in program.usingInquirer
which indicates
whether inquander is using inquirer or commander.
One can also pass Promises in for any value inside of the overrides object, for instance:
``Javascript inquander.parse(program, process.argv, { overrides: { 'creditcard': { type: 'password' }, 'pickup': { type: 'checkbox', choices: Promise.resolve(['one','two']) } } });
FAQs
Inquirer for commander. If no arguments and options are passed to your commander app, it runs inquirer.
The npm package inquander receives a total of 92 weekly downloads. As such, inquander popularity was classified as not popular.
We found that inquander demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.