Skip to content

Instantly share code, notes, and snippets.

@loretoparisi
Created October 18, 2016 14:30
Show Gist options
  • Save loretoparisi/0416efb4e48db3ed10ee78d33bb24339 to your computer and use it in GitHub Desktop.
Save loretoparisi/0416efb4e48db3ed10ee78d33bb24339 to your computer and use it in GitHub Desktop.
Cool node.js stdout spinner
const spinner = [ '⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏' ];
for(var count=0;count<100000;count++) process.stdout.write(" "+spinner[ (count+1)% spinner.length ]+"\033[0G" ); // \033[0G | \r | \x1B[0G
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment