inquirer-confirm-validated
v1.0.0
Published
Inquirer confirm prompt with validation
Downloads
20
Readme
Inquirer Confirm-with-Validation Prompt
A plugin for Inquirer, adding validation to the confirm prompt.
Basically use it as if regular confirm had validate
implemented.
Installation
npm install inquirer-confirm-validated
Example usage
inquirer.registerPrompt('confirm-validated', require('inquirer-confirm-validated'));
inquirer.prompt({
type: 'confirm-validated',
validate(input, answers) {
if (input === true && answers.openThePodBayDoors === true) {
return "I'm sorry Dave, I'm afraid I can't do that";
}
return true;
},
...
});