0.1.0 • Published 5 years ago

mpb v0.1.0

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

MultiProgressBar

Flexible progress bar for terminal

Build Status

Features

Examples

Multiple progress bar

import { MultiProgressBar } from 'mpb';

const multi = MultiProgressBar.create({
  title: 'progress'
});

const bar = multi.createBar({
  title: 'bar 1'
});

const timer = setInterval(() => {
  bar.tick(1);
}, 100);

bar.events.on('complete-post', () => {
  clearInterval(timer);
});


const bar2 = multi.createBar({
  title: 'bar 2',
  clean: true
});

const timer2 = setInterval(() => {
  bar2.tick(1);
}, 50);

bar2.events.on('complete-post', () => {
  clearInterval(timer2);
});

Single progress bar

import { ProgressBar } from 'mpb';

const bar = ProgressBar.create({
  title: 'progress'
});

const timer = setInterval(() => {
  bar.tick(1);
}, 100);

bar.events.on('complete-post', () => {
  clearInterval(timer);
});

Use the theme

import { ProgressBar, themes } from 'mpb';

ProgressBar.create({
  title: 'progress',
  render: themes.inverse,
});

Custom render

more examples

Screenshot

Single progress bar

Single progress bar

Multiple progress bar

Multiple progress bar

Custom render

Custom render

Progress bar width logger

Progress bar width logger

Run examples

yarn build
cd examples
yarn
ts-node src/multi.ts

API docs