Created
April 1, 2020 04:53
-
-
Save tonitrnel/4eaf3950f183c9e586fbe6220edcfb33 to your computer and use it in GitHub Desktop.
NodeJS clear PowerShell terminal screen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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