Skip to content

Instantly share code, notes, and snippets.

@dmamills
Last active August 29, 2015 14:00
Show Gist options
  • Select an option

  • Save dmamills/11386650 to your computer and use it in GitHub Desktop.

Select an option

Save dmamills/11386650 to your computer and use it in GitHub Desktop.
var i = j = 0,a=[];
setInterval(function() {
process.stdout.clearLine();
process.stdout.cursorTo(0);
if(++i>20) i=0;
for(j=0;j<i;j++) a.push('x');
for(;j<20;j++)a.push(' ');
process.stdout.write('['+ a.join('')+ '] ' + i +'/20');
a=[];
},100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment