-
-
Notifications
You must be signed in to change notification settings - Fork 34.6k
Closed
Labels
readlineIssues and PRs related to the built-in readline module.Issues and PRs related to the built-in readline module.
Description
What is the problem this feature will solve?
When I close readline, readline.question still prompts the question, but the callback won't be called and the process hangs!
const readline = require('readline').createInterface({
input: process.stdin,
output: process.stdout
})
readline.question(`What's your name?`, name => {
console.log(`Hi ${name}!`)
readline.close()
readline.question(`How are you?`, how => {
console.log(`Good to know you are ${how}!`)
//readline.close() should close here
})
})What is the feature you are proposing to solve the problem?
If readline.close() I think it is better readline.question not prompt, so no hang either.
What alternatives have you considered?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
readlineIssues and PRs related to the built-in readline module.Issues and PRs related to the built-in readline module.