(prompt: string)
| 148 | } |
| 149 | |
| 150 | export async function input(prompt: string): Promise<string> { |
| 151 | const readline = require("readline") |
| 152 | const rl = readline.createInterface({ |
| 153 | input: process.stdin, |
| 154 | output: process.stdout, |
| 155 | }) |
| 156 | |
| 157 | return new Promise((resolve) => { |
| 158 | rl.question(prompt, (answer: string) => { |
| 159 | rl.close() |
| 160 | resolve(answer.trim()) |
| 161 | }) |
| 162 | }) |
| 163 | } |
| 164 | |
| 165 | export function error(message: string) { |
| 166 | println(Style.TEXT_DANGER_BOLD + "Error: " + Style.TEXT_NORMAL + message) |