You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let's run automatic. But i want to "move" the spinner programatically like
varcountdown=newCLI.Spinner('Running... ',['⣾','⣽','⣻','⢿','⡿','⣟','⣯','⣷']);setInterval(function(){countdown.tick();},1000);// each second, the spinner moves...
The text was updated successfully, but these errors were encountered:
Well the symbols are in the order they are to be animated, so why not just output and replace each symbol every tick?
So something like
var spinnerSymbols = ['⣾','⣽','⣻','⢿','⡿','⣟','⣯','⣷'];
var i = 0;
setInterval(function() {
process.stdout.clearLine(); // clear line
process.stdout.cursorTo(0); // move to the start of the line
process.stdout.write(spinnerSymbols[i]); // write the symbol
// Increase the counter until it reaches the end of the array
if(i >= (spinnerSymbols.length - 1)) {
i = 0;
} else {
i++;
}
}, 1000); // each second, the spinner moves...
I wan't to tick manually the spinner.
For sample
let's run automatic. But i want to "move" the spinner programatically like
The text was updated successfully, but these errors were encountered: