[Node.js] I CANNOT clear the console at the same line.
tingwei628 (0)

Here is the code.

var readline = require("readline");
var i = 0;
setInterval(function () {
	readline.cursorTo(process.stdout, 0);
}, 300);
You are viewing a single comment. View All
eankeen (988)


yes, the current tty interface is sometimes broken when dealing with clearing certain lines (and even the whole screen). this is a known issue. when programming a python repl, repl.it has a custom library you can import that clears the whole screen. unfortunately, no such solution is available for node.

hope i was able to help :)