How to use the readline.clearLine function in readline

To help you get started, we’ve selected a few readline examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github damonjs / damon / src / reporter.js View on Github external
function clear () {
    readline.clearLine(writeStream);
    readline.cursorTo(writeStream, 0);
}
github albertosantini / node-nanoirc / lib / nanoirc.js View on Github external
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);
    }
github Siteimprove / alfa / scripts / helpers / notify.js View on Github external
function replace() {
  readline.moveCursor(stream, 0, -1);
  readline.clearLine(stream, 0);
  readline.cursorTo(stream, 0, 0);
}
github 6 / braille-pattern-cli-loading-indicator / index.js View on Github external
function resetLineAndCursor () {
  readline.clearLine(process.stdout, 0)
  readline.cursorTo(process.stdout, 0)
}
github GoogleChrome / lighthouse / lighthouse-core / scripts / lantern / collect-traces.js View on Github external
progress(message) {
    this._currentProgressMessage = message;
    readline.clearLine(process.stdout, 0);
    readline.cursorTo(process.stdout, 0);
    if (message) process.stdout.write(`${this._nextLoadingChar()} ${message}`);
  }

readline

Simple streaming readline module.

BSD
Latest version published 9 years ago

Package Health Score

62 / 100
Full package analysis