progress
var ProgressBar = require("progress");
var bar = new ProgressBar("[ :bar ]", { total: 10 });
var timer = setInterval(function() {
bar.tick();
if (bar.complete) {
console.log("\ncomplete\n");
clearInterval(timer);
}
}, 100);
λ node test.js
[ ========== ]
complete
ora
const ora = require("ora");
const spinners = [ora("Loading..."), ora("Loading...")];
spinners[0].start();
setTimeout(() => {
spinners[0].succeed("Sucess ");
spinners[1].start();
}, 5000);
setTimeout(() => {
spinners[1].fail("Fail ");
}, 5000);
λ node test.js
√ Sucess
× Fail