(prompt: string)
| 102 | } |
| 103 | |
| 104 | export async function input(prompt: string): Promise<string> { |
| 105 | const readline = require("readline") |
| 106 | const rl = readline.createInterface({ |
| 107 | input: process.stdin, |
| 108 | output: process.stdout, |
| 109 | }) |
| 110 | |
| 111 | return new Promise((resolve) => { |
| 112 | rl.question(prompt, (answer: string) => { |
| 113 | rl.close() |
| 114 | resolve(answer.trim()) |
| 115 | }) |
| 116 | }) |
| 117 | } |
| 118 | |
| 119 | export function error(message: string) { |
| 120 | if (message.startsWith("Error: ")) { |