node-progress icon indicating copy to clipboard operation
node-progress copied to clipboard

Update current value

Open slavafomin opened this issue 4 years ago • 0 comments

It's not always possible/convenient to specify the delta value in the tick() method, sometimes you only have access to the current value. It would be very convenient to be able to update the current value directly.

Example:

const progressBar = new ProgressBar('[:bar]', {
  total: 10,
});

// some time later
progressBar.setCurrent(1);

// some time later
progressBar.setCurrent(3);

// some time later
progressBar.setCurrent(5);

// some time later
progressBar.setCurrent(8);

// some time later
progressBar.setCurrent(10);

slavafomin avatar Apr 22 '21 01:04 slavafomin