Reputation: 33
When running the demo script from Node.js's inquirer
library the prompt on my terminal appears twice while I would like it to appear only once.
Here is my script:
import inquirer from "inquirer"
inquirer
.prompt([{
"name":"King of France",
"message":"Who is the king of France"
}
])
.then((answers) => {
// console.log(answers)
console.log("Nothing should be printed.")
})
.catch((error) => {
if (error.isTtyError) {
console.log(erorr)
} else {
console.log(error)
}
});
Which has the following outputs:
To be more precise, it appears once when I launch the script and a second time just as I reply on my terminal.
Upvotes: 0
Views: 231