Created
June 16, 2013 13:24
-
-
Save 101v/5792040 to your computer and use it in GitHub Desktop.
This file contains 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
function inPlacePrinter() { | |
console.log("\u001B[2J\u001B[0;0f"); | |
console.log(arguments[0]["toString"]()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This function clears the screen and print first argument in place.
Where "\u001B[2J" is ASCII instruction to clear the screen and "\u001B[0;0f" is ASCII instruction to set cursor at 0,0.