String Progressbar Animated - Sparker-99/string-progressbar GitHub Wiki

So string-progressbar can be animated in cli. You will require an additional package named ansi-diff-stream.

Gif

Usage

const diff = require('ansi-diff-stream')();
const { splitBar } = require('string-progressbar');

let cr = 0;

var int = setInterval(function () {
    let value = splitBar(100, cr++, size = 100, line = "=", slider = 'x');

    diff.write(value[0] + " [" + value[1].toFixed(1) + "%]")

    if (100 < cr) {
        clearInterval(int);
        setTimeout(() => { process.exit() }, 1000)
    }

}, 100)

diff.pipe(process.stdout)

NOTE: Emojis do not support on cli.