( question: string, defaultValue: string, opts: PromptOptions, )
| 241 | |
| 242 | /** Free-text prompt with default. */ |
| 243 | export async function text( |
| 244 | question: string, |
| 245 | defaultValue: string, |
| 246 | opts: PromptOptions, |
| 247 | ): Promise<string> { |
| 248 | if (!opts.interactive) return defaultValue; |
| 249 | const hint = defaultValue ? ` (default: ${defaultValue})` : ''; |
| 250 | const ans = (await readLine(`${question}${hint}: `)).trim(); |
| 251 | return ans || defaultValue; |
| 252 | } |
| 253 | |
| 254 | /** Render a section header. Output-only — no I/O wait. */ |
| 255 | export function section(title: string): void { |
no test coverage detected