How to use the inquirer.promptAsync function in inquirer

To help you get started, we’ve selected a few inquirer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mgcrea / node-easyrsa / src / bin / easyrsa.js View on Github external
.catch({code: 'EEXIST'}, (err) => {
        log.warn('You are about to remove the EASYRSA_PKI at: %s and initialize a fresh PKI here.', pki.dir);
        return inquirer.promptAsync({name: 'confirm', message: 'Confirm removal', type: 'confirm', default: false})
          .catch(({confirm}) => {
            if (!confirm) {
              process.exit(1);
            }
            return pki.initPKI({force: true});
          });
      })
      .then(() => {