Monday 19 December 2016

[Question] Backspacing text in readline, removes process.stdout.write() ??

So I have been using the readline module with node and I noticed that in the code below pressing backspace in the input field in the console will actually backspace the "Send text: " string. If anyone can tell me how to fix this it would be greatly appreciated. Many thanks. const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); process.stdout.write("Send text: "); rl.on("line", function(input) { process.stdout.write("Send text: ") });

Submitted December 19, 2016 at 01:54PM by Kempster3

No comments:

Post a Comment