Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T

  • K: IBaseGeneratorArgs

Hierarchy

Index

Modules

Constructors

Properties

Methods

Constructors

constructor

  • new JibGen(...args: any[]): JibGen

Properties

arguments

arguments: K

config

config: Yeoman.Storage

fs

fs: Yeoman.MemFsEditor

options

options: T

Methods

argument

  • argument(name: string, config: IGeneratorArgument): this
  • 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.

    Parameters

    • name: string

      Argument name

    • config: IGeneratorArgument

      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;

    Returns this

composeWith

  • composeWith(name: string, options?: SubGeneratorOptions): this
  • 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.

    Parameters

    • name: string

      subgenerator name registered in the GeneratorEnv

    • Optional options: SubGeneratorOptions

      options passed to the subgenerator instance

    Returns this

option

  • option(name: string, config: IGeneratorOption): this
  • 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.

    Parameters

    • name: string

      Option name

    • config: IGeneratorOption

      Option configuration

      this.option('language', {
        alias: 'l',
        type: String,
        description: 'specify output language',
        default: 'JavaScript',
      });
      
      // read the option
      const language = this.options.language;

    Returns this

prompt

  • prompt(prompts: Yeoman.Questions): Promise<Yeoman.Answers>
  • Prompt for user input based on inquirer

    Parameters

    • prompts: Yeoman.Questions

      prompt question configurations

    Returns Promise<Yeoman.Answers>