Here is my code:
readline = require("readline");
input = readline.createInterface({
input: process.stdin,
output: process.stdout
});
while (true) {
input.question("What do you want me to do?", answer => {
console.log("1");
//do stuff with answer
input.close();
});
console.log("2");
}
(The console.log()s are just so I can see what code is evaluated and which isn't)
This just returns What do you want me to do?2 over and over again. It also doesn't let me type anything in to the console.
How can I fix this? I've looked all over and haven't found anything.