Skip to main content
Module

x/input/index.ts>default

CLI user input handler for Deno
Latest
class default
import { default } from "https://deno.land/x/input@2.0.4/index.ts";

Constructors

new
default(args?: IConfig)

Properties

private
buf: Uint8Array
private
cleanInput: (value?: string) => string
private
coerceChoice: (value: string | number) => string
private
readPrivate: () => Promise<string>
choose: (
options: string[],
lastOptionClose?: boolean,
privateInput?: boolean,
choice?: string | number,
) => Promise<boolean[]>

Prompts the user to choose from a list of options

close: () => unknown

Closes the loop

done: boolean
history: History
out: Printer
question: (
question: string,
includeNewline?: boolean,
privateInput?: boolean,
value?: string | number,
) => Promise<string>

Prompts the user to answer a question

read: (privateInput: boolean) => Promise<string>

Read input from the console

repeat: (value?: string | number) => unknown

Repeats the last prompt

wait: (question?: string, includeNewline?: boolean) => Promise<boolean>