Advertisement
BafS

How to update data on multiple lines of console

Dec 3rd, 2013
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var _logInline = function(alpha, bravo) {
  2.     process.stdout.cursorTo(0, 0);
  3.     process.stdout.write(alpha.toString() + '\n');
  4.     process.stdout.write(bravo.toString() + '\n');
  5.     process.stdout.clearLine();
  6. };
  7.  
  8. var delay = 1000;
  9. var time = 0;
  10. setInterval(function() {
  11.     time++;
  12.     _logInline('alpha-' + time, 'bravo-' + time * time);
  13. }, delay);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement