1.6.0 • Published 8 months ago

the-ultimate-unicorn v1.6.0

Weekly downloads
-
License
LGPL 2.1
Repository
github
Last release
8 months ago

the-ultimate-unicorn (multi-progress was already taken)

The ultimate unicorn intend (like multi-progress) to add a layer on top of the progress API to allow multiple progress bars.

API and implementation differs a bit.

Quick start

npm i the-ultimate-unicorn
const ProgressBar = require('the-ultimate-unicorn');

// ...

const progressBar = new ProgressBar({ title: 'Potatoes', total: 142 });

const intervalId = setInterval(() => {
  progressBar.tick();

  if (progressBar.isComplete) {
    clearInterval(intervalId);
  }
}, 100);

Doc

Api is very similar to the progress one. With subtile differences.


new ProgressBar(options?)

Create a new progressBar

  • options.total (default: 100) int: Total tick to consider the progressBar complete
  • options.title (default: '') string: Title of the progressBar
  • options.current (default 0) int: Initial progressBar ticks
  • options.chars (default { complete: '=', incomplete: '-' }) object: Characters use to draw the progressBar
  • options.format (default ':title :bar :etas') string: Template string used to draw the progressBar

progressBar.tick()

Add a tick to a ProgressBar instance


progressBar.complete()

Force complete a progress bar


Static properties

  • ProgressBar.renderThrottle (default 16) int: Minimum period beteween 2 progressBar render (default: 16)
  • ProgressBar.stream (default process.stderr) stream: Output stream
1.6.0

8 months ago

1.4.0

11 months ago

1.3.0

1 year ago

1.2.0

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago