Argument name
Argument configuration
this.argument('prefix', {
type: String,
description: 'A prefix for the generated code',
required: false,
default: '',
});
// read the argument
const prefix = this.options.prefix;
Add a subgenerator run loop. Methods will be executed in parallel following the standard yeoman run loop. Note that options.parent will be automatically assigned as the generator from which the method is called. Options are also inherited from the parent generator.
subgenerator name registered in the GeneratorEnv
options passed to the subgenerator instance
prep the generator composition
initialize the target workspace
perform package installation
Specify options for the generator. Generally preferred in teh constructor.
Options are assigned by camelCase name to the this.options
hash.
See documentation for
more information.
Option name
Option configuration
this.option('language', {
alias: 'l',
type: String,
description: 'specify output language',
default: 'JavaScript',
});
// read the option
const language = this.options.language;
Prompt for user input based on inquirer
prompt question configurations
prompt as necessary
write files to memfs
Specify arguments for the generator. Generally preferred in the constructor. Arguments are assigned by name to the
this.options
hash. See documentation for more information.