PerplexiBot/libs/readin.ts
2024-03-24 20:12:01 +01:00

12 lines
290 B
TypeScript

import * as readline from "readline/promises";
export default async function readin(q: string = ""): Promise<string> {
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let answer = await rl.question(q);
rl.close();
return answer;
}