Socket
Book a DemoInstallSign in
Socket

inquirer-confirm-validated

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inquirer-confirm-validated

Inquirer confirm prompt with validation

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
125
-30.56%
Maintainers
1
Weekly downloads
 
Created
Source

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;
  },
  ...
});

Keywords

inquirer

FAQs

Package last updated on 17 Jul 2018

Did you know?

Socket

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.

Install

Related posts