How to use the enquirer.BooleanPrompt function in enquirer

To help you get started, we’ve selected a few enquirer 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 enquirer / enquirer / examples / boolean / option-initial.js View on Github external
const { BooleanPrompt } = require('enquirer');

const prompt = new BooleanPrompt({
  name: 'answer',
  message: 'Want to answer?',
  initial: false
});

prompt.run()
  .then(answer => console.log('Answer:', answer))
  .catch(console.error);
github enquirer / enquirer / examples / boolean / prompt.js View on Github external
const { BooleanPrompt } = require('enquirer');

const prompt = new BooleanPrompt({ name: 'answer', message: 'Want to answer?' });

prompt.run()
  .then(answer => console.log('Answer:', answer))
  .catch(console.error);