yeoman-option-or-prompt
Provides a helper for yeoman generators that wraps the prompt method with code that will exclude any prompts for data that has been supplied via options.
To install use
npm install yeoman-option-or-prompt --save
To use it, just add optionOrPrompt as an internal function on your generator and call it in place of the yeoman-generator prompt
method:
var yeoman = ;var optionOrPrompt = ;moduleexports = yeomangeneratorsBase
You can also pass options to subgenerators, with:
{this;ifthisexamplesthis;}
Now if another app calls your generator, they can supply values for each of your prompts with the options parameter. Alternatively, a user can supply values for your prompts on the command line:
yo single-page-app --name="App that saves the world."