readline-promise icon indicating copy to clipboard operation
readline-promise copied to clipboard

Cannot await questionAsync method

Open dipapazacharias opened this issue 4 years ago • 1 comments

I'm trying to do this:

const readline = require('readline-promise').default.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

const myFunc = async function(){
  const q = "What is your favorite something?
  const res = await readline.questionAsync(q)
  console.log(res)
}

myFunc()

But after I give the answer, the execution stalls and the console.log() does not run

dipapazacharias avatar Jul 06 '20 10:07 dipapazacharias

@dipapazacharias Not sure if you're still running into this, but I spun up a quick example based on your snippet and I am not running into the same issue...

https://repl.it/@brandongscott/RoundedAnimatedUnits

brandongregoryscott avatar Mar 02 '21 13:03 brandongregoryscott