Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function clear () {
readline.clearLine(writeStream);
readline.cursorTo(writeStream, 0);
}
function printMessage({
from = null,
me = null,
to = null,
text = "",
timestamp = new Date()
} = {}) {
const message = formatter(from, me, to, text, timestamp);
readline.clearLine(process.stdout, 0);
readline.cursorTo(process.stdout, 0);
process.stdout.write(message);
rl.prompt(true);
}
function replace() {
readline.moveCursor(stream, 0, -1);
readline.clearLine(stream, 0);
readline.cursorTo(stream, 0, 0);
}
function resetLineAndCursor () {
readline.clearLine(process.stdout, 0)
readline.cursorTo(process.stdout, 0)
}
progress(message) {
this._currentProgressMessage = message;
readline.clearLine(process.stdout, 0);
readline.cursorTo(process.stdout, 0);
if (message) process.stdout.write(`${this._nextLoadingChar()} ${message}`);
}