How to use the inquirer/lib/prompts/base.prototype 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 FormidableLabs / builder-init / test / server / spec / lib / prompts.spec.js View on Github external
beforeEach(function () {
    // Intercept all real stdin/stdout.
    runStub = base.sandbox.stub(Prompt.prototype, "run");
  });
github serverless / serverless / lib / plugins / interactiveCli / inquirer.js View on Github external
cyan: {
      get() {
        return chalk.bold;
      },
    },
    bold: {
      get() {
        return chalk.bold.yellow;
      },
    },
  });

  // 'Serverless:' prefix
  const BasePrompt = require('inquirer/lib/prompts/base');
  const originalGetQuestion = BasePrompt.prototype.getQuestion;
  BasePrompt.prototype.getQuestion = function() {
    this.opt.prefix = 'Serverless:';
    return originalGetQuestion.call(this);
  };

  return require('inquirer');
});
github serverless / serverless / lib / plugins / interactiveCli / inquirer.js View on Github external
Object.defineProperties(require(inquirersChalkPath), {
    cyan: {
      get() {
        return chalk.bold;
      },
    },
    bold: {
      get() {
        return chalk.bold.yellow;
      },
    },
  });

  // 'Serverless:' prefix
  const BasePrompt = require('inquirer/lib/prompts/base');
  const originalGetQuestion = BasePrompt.prototype.getQuestion;
  BasePrompt.prototype.getQuestion = function() {
    this.opt.prefix = 'Serverless:';
    return originalGetQuestion.call(this);
  };

  return require('inquirer');
});