DEV Community

Discussion on: Creating Scaffolds and Generators using Yeoman.

Collapse
 
adilgro profile image
Adil grover

One of the main goals of creating a generator is the interaction with the user. To do so we can use Prompts. Where do we add boiler plate code following this? This code :
async prompting() {
this.answers = await this.prompt([{
type: 'input',
name: 'name',
message: 'Your project name',
default: this.appname, // appname return the default folder name to project
store: true,
},
{
type: 'list',
name: 'templateType',
message: 'Select the template wanted:',
choices: ['Front-End React', 'Node API builder', 'FullStack Application']
}]);
}