Skip to content

Instantly share code, notes, and snippets.

@markcode
Last active March 3, 2024 15:01
Show Gist options
  • Save markcode/a8b1bfa545bb701daa2c to your computer and use it in GitHub Desktop.
Save markcode/a8b1bfa545bb701daa2c to your computer and use it in GitHub Desktop.
node.js print resfeshing over the same line
var util = require('util');
var x = 0;
setInterval(function() {
process.stdout.write('hello: ' + x + '\r'); // needs return '/r'
// util.print('hello: ' + x + '\r'); // could use this too
x++;
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment