Global

Type Definitions

PromptletOptions

Source:
Properties:
Name Type Attributes Default Description
optionName string <optional>

The string displayed on the list of prompts from PromptSet.selectPromptlet(). Required unless running a Promptlet by itself

name string

Name for the Promptlet. Used as the key in PromptSet.reduce

message string

Text displayed when the Promptlet is run

type string <optional>
"input"

Type of inquirer.js prompt to display

default string | number | boolean | function <optional>

Value to use if blank answer is given or a function that returns a value to use

prerequisites Array.<string> <optional>

Array of Promptlet names. Promptlets with those names must be answered before this instance can run. (Note: Setting prerequisites with this property bypasses function that checks to make sure the Promptlets with these names exist)

filter function | Array.<function()> <optional>

Constructor-only shortcut property. All functions in the filter property will be passed to this.addFilter

validate function | Array.<function()> <optional>

Constructor-only shortcut property. All functions in the validate property will be passed to this.addValidator

allowBlank boolean <optional>
true

Constructor-only shortcut property for setter Promptlet.allowBlank

autoTrim boolean <optional>
true

Constructor-only shortcut property for setter Promptlet.autoTrim

value string | boolean | number <optional>
"<Incomplete>"

Constructor-only shortcut property for forcefully setting a value for Promptlet.value without running it first

required boolean <optional>
false

Whether this Promptlet MUST be answered before closing a PromptSet. Does nothing if Promptlet is run directly

editable boolean <optional>
false

Whether the prompt can be selected and answered again after being completed once

Options for the Promptlet. Not every property is documented here.
Some properties have been overridden: filter & validate (use addFilter() and addValidator() instead)
Options are passed to inquirer.js so additional properties and option can be found here

Type:
  • Object