Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I register an inquirer.js plugin for a yeoman generator prompt?

When authoring a yeoman generator, I'd like to use the 'autocomplete' plugin for inquirer (https://github.com/mokkabonna/inquirer-autocomplete-prompt) in one of my prompts. I can't seem to find anything in the docs that says how to register this plugin with inquirer from within the yeoman generator. Is this possible?

like image 439
Ben Avatar asked Mar 28 '18 06:03

Ben


Video Answer


1 Answers

found the answer :

module.exports = class extends Generator {
  initializing() {
    this.env.adapter.promptModule.registerPrompt("autocomplete", require("inquirer-autocomplete-prompt"));
  }
}
like image 139
Ben Avatar answered Oct 19 '22 21:10

Ben