Skip to content

Instantly share code, notes, and snippets.

@alieslamifard
Created March 5, 2019 14:26
Show Gist options
  • Save alieslamifard/fa62769518b251a7ce3ead670a6a4ccc to your computer and use it in GitHub Desktop.
Save alieslamifard/fa62769518b251a7ce3ead670a6a4ccc to your computer and use it in GitHub Desktop.
yeoman generator
prompting() {
// Have Yeoman greet the user.
this.log(yosay(`Welcome from ${chalk.yellow('KIAN')} development team.`));
const prompts = [
{
type: 'input',
name: 'name',
message: 'project name?'
},
{
type: 'confirm',
name: 'cool',
message: 'Would you like to enable the Cool feature?'
}
];
return this.prompt(prompts).then(props => {
// To access props later use this.props.someAnswer;
this.props = props;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment