Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Question

Index

Properties

Optional choices

choices: ChoiceType[] | function

Choices array or a function returning a choices array. If defined as a function, the first parameter will be the current inquirer session answers. Array values can be simple strings, or objects containing a name (to display) and a value properties (to save in the answers hash). Values can also be a Separator.

Optional default

default: any | function

Default value(s) to use if nothing is entered, or a function that returns the default value(s). If defined as a function, the first parameter will be the current inquirer session answers.

Optional mask

mask: string

Add a mask when password will entered

Optional message

message: string | function

The question to print. If defined as a function, the first parameter will be the current inquirer session answers.

Optional name

name: string

The name to use when storing the answer in the anwers hash.

Optional pageSize

pageSize: number

Change the number of lines that will be rendered when using list, rawList, expand or checkbox.

Optional paginated

paginated: boolean

Optional prefix

prefix: string

Change the default prefix message.

Optional store

store: boolean

whether to store the user's previous answer

Optional suffix

suffix: string

Change the default suffix message.

Optional type

type: string

Type of the prompt. Possible values:

  • input
  • confirm
  • list
  • rawlist
  • password
defaults:

'input'

Optional when

when: boolean | function

Receive the current user answers hash and should return true or false depending on whether or not this question should be asked. The value can also be a simple boolean.

Methods

Optional filter

  • filter(input: string): string
  • Receive the user input and return the filtered value to be used inside the program. The value returned will be added to the Answers hash.

    Parameters

    • input: string

    Returns string

Optional validate

  • validate(input: string, answers?: Answers): boolean | string
  • Receive the user input and should return true if the value is valid, and an error message (String) otherwise. If false is returned, a default error message is provided.

    Parameters

    • input: string
    • Optional answers: Answers

    Returns boolean | string

Generated using TypeDoc