How to use the readline.clearScreenDown 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 quantumsheep / warshield / src / UserInterface.js View on Github external
function clearScreen() {
  const blank = '\n'.repeat(process.stdout.rows);
  console.log(blank);
  readline.cursorTo(process.stdout, 0, 0);
  readline.clearScreenDown(process.stdout);
}
github shroudedcode / devstats / src / libs / terminal.ts View on Github external
export function render(str: string) {
  if (lines) {
    readline.moveCursor(stdout, 0, -lines)
    readline.clearScreenDown(stdout)
  }

  lines = (str.match(/\n/g) || []).length
  stdout.write(str)
}

readline

Simple streaming readline module.

BSD
Latest version published 9 years ago

Package Health Score

62 / 100
Full package analysis