Skip to content

Instantly share code, notes, and snippets.

@vyuvalv
Created October 28, 2019 15:27
Show Gist options
  • Save vyuvalv/01e1b7f8aa08d7bc5cafd1f1d6669541 to your computer and use it in GitHub Desktop.
Save vyuvalv/01e1b7f8aa08d7bc5cafd1f1d6669541 to your computer and use it in GitHub Desktop.
Prompting questions on yeoman
async prompting() {
const menuQuestions = await this.prompt([ {
type: 'checkbox',
name: 'mainMenu',
message: 'What would you like to do?',
choices: [
{
name: ’option1',
value: ’option1',
checked: true
}, {
name: ’option2’,
value: ’option2',
checked: false
}]
}]).then((menuQuestions) => {
this.selectedOptions = menuQuestions.mainMenu;
this.log( ”you selected ” + this.selectedOptions );
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment