-
-
Save constgen/4162b5f07b3b6feb9405c2153266ac09 to your computer and use it in GitHub Desktop.
Clear console/terminal in node.js the right way
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
const readline = require('readline') | |
const blank = '\n'.repeat(process.stdout.rows) | |
console.log(blank) | |
readline.cursorTo(process.stdout, 0, 0) | |
readline.clearScreenDown(process.stdout) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment