How to use the readline.cursorTo 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 googlemaps / transport-tracker / backend / generate_paths.js View on Github external
function logProgress(str) {
  // A little bit of readline magic to not fill the screen with progress messages.
  readline.clearLine(process.stdout, 0);
  readline.cursorTo(process.stdout, 0, null);
  process.stdout.write(str);
}
github superpowers / superpowers-core / server / commands / utils.ts View on Github external
function onProgress(value: number) {
  value = Math.round(value * 100);

  readline.clearLine(process.stdout, 0);
  readline.cursorTo(process.stdout, 0, 1);
  console.log(`${value}%`);
  if (process != null && process.send != null) process.send({ type: "progress", value });
}
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 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}`);
  }
github damonjs / damon / src / reporter.js View on Github external
function clear () {
    readline.clearLine(writeStream);
    readline.cursorTo(writeStream, 0);
}

readline

Simple streaming readline module.

BSD
Latest version published 9 years ago

Package Health Score

62 / 100
Full package analysis