Skip to content

Instantly share code, notes, and snippets.

@101v
Created June 16, 2013 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 101v/5792040 to your computer and use it in GitHub Desktop.
Save 101v/5792040 to your computer and use it in GitHub Desktop.
function inPlacePrinter() {
console.log("\u001B[2J\u001B[0;0f");
console.log(arguments[0]["toString"]());
}
@101v
Copy link
Author

101v commented Jun 16, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment