import { Input } from "https://deno.land/x/cliffy@v1.0.0-rc.1/prompt/mod.ts";
Input prompt representation.
import { Input } from "./mod.ts";
const confirmed: string = await Input.prompt("Enter your name");
Constructors
new
Input(options: string | InputOptions)Methods
protected
format(value: string): stringFormat output value.
protected
getValue(): stringGet input value.
protected
success(value: string): string | undefinedprotected
transform(value: string): string | undefinedMap input value to output value.
protected
validate(value: string): boolean | stringValidate input value.
getDefaultSettings(options: InputOptions): InputSettings
Static Methods
inject(value: string): void
Inject prompt value. If called, the prompt doesn't prompt for an input and returns immediately the injected value. Can be used for unit tests or pre selections.
prompt(options: string | InputOptions): Promise<string>
Execute the prompt with provided options.