public choose(options: Array<string>, callback: (idx: number) => any)
Prompt for password with str, mask char and callback fn(val).
The mask string defaults to '', aka no output is written while typing, you may want to use "*" etc.
Parameters
options: Array<string>
callback: (idx: number) => any
public choose(options: Array<any>, callback: (idx: number) => any)
Define option with flags, description and optional coercion function and default value.
The flags string should contain both the short and long flags
separated by comma, a pipe or space. The following are all valid
all will output this way when --help is used.
"-p, --pepper"
"-p|--pepper"
"-p --pepper"
Parameters
flags: string
the option flags.
description: string
the option description. The description is printed when "--help" is used.
coerceFn?: (value: string) => anyoptional
(optional) specifies a callback function to coerce the option arg.
public password(label: string, mask: string, callback: (value: string) => any)
Prompt for password with a label, a optional mask char and callback function.
The mask string defaults to '', aka no output is written while typing, you may want to use "*" etc.
Parameters
label: string
mask: string
callback: (value: string) => any
public password(label: string, callback: (value: string) => any)
Parameters
label: string
callback: (value: string) => any
public prompt(label: string, callback: (value: string) => any)
Parameters
label: string
callback: (value: string) => any
public promptForDate(label: string, callback: (value: Date) => any)
Parameters
label: string
callback: (value: Date) => any
public promptForNumber(label: string, callback: (value: number) => any)
Parameters
label: string
callback: (value: number) => any
public promptMultiLine(label: string, callback: (value: string) => any)
Parameters
label: string
callback: (value: string) => any
public promptSingleLine(label: string, callback: (value: string) => any)