aboutsummaryrefslogtreecommitdiff
path: root/src/utils.js
blob: ecb2c4afb87ec79a9cfcaee1d6c50caab827965a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import readline from "readline";

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
});

export function getInput(question) {
  return new Promise((resolve) => {
    rl.question(question, (userInput) => {
      resolve(userInput);
    });
  });
}