method Prompter.select
Prompter.select(
question: string,
choices: readonly PromptChoice[]
): Promise<string | undefined>

Asks one question and reports the chosen value.

Parameters

question: string

The question text; the default is rendered inside it

choices: readonly PromptChoice[]

The acceptable answers, first being the default

Return Type

Promise<string | undefined>

The chosen value, or undefined when no answer could be taken

Usage

import { type Prompter } from "cli/src/index.ts";