Skip to content

Instantly share code, notes, and snippets.

@tonitrnel
Created April 1, 2020 04:53
Show Gist options
  • Save tonitrnel/4eaf3950f183c9e586fbe6220edcfb33 to your computer and use it in GitHub Desktop.
Save tonitrnel/4eaf3950f183c9e586fbe6220edcfb33 to your computer and use it in GitHub Desktop.
NodeJS clear PowerShell terminal screen
import readline from 'readline'
for (let i = 0; i < process.stdout.rows; i++) {
readline.cursorTo(process.stdout, 0, i)
readline.clearLine(process.stdout, 0)
}
readline.cursorTo(process.stdout, 0, 0)
process.stdout.write('\x1b[3J')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment