How to use the suman-inquirer.restoreDefaultPrompts function in suman-inquirer

To help you get started, we’ve selected a few suman-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 sumanjs / suman / lib / interactive / index.js View on Github external
function start() {


    // process.stdin.removeAllListeners('keypress');
    // process.stdin.removeAllListeners('end');
    _interactiveDebug('readable count:', process.stdin.listenerCount('readable'));
    _interactiveDebug('keypress count:', process.stdin.listenerCount('keypress'));
    _interactiveDebug('keypress count:', process.stdin.listenerCount('keypress'));

    inquirer.restoreDefaultPrompts();

    inquirer.prompt(firstSetOfQuestions).then(function (respuestas) {
      if (respuestas.action === choices.topLevelOpts.GenerateCommand) {
        return secondSet(start);
      }
      else if (respuestas.action === choices.topLevelOpts.Learn) {
        throw new Error('Learn the Suman API is not implemented yet.');
      }
      else if (respuestas.action === choices.topLevelOpts.Troubleshoot) {
        throw new Error('Troubleshoot is not implemented yet.');
      }
      else {
        throw new Error('Action not recognized.');
      }

    }).catch(rejectionHandler);

suman-inquirer

A collection of common interactive command line user interfaces.

MIT
Latest version published 7 years ago

Package Health Score

60 / 100
Full package analysis