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