MCPcopy Create free account
hub / github.com/npkgz/cli-progress / runSinglebar

Function runSinglebar

examples/example-synchronous.js:13–31  ·  view source on GitHub ↗
(options, limit)

Source from the content-addressed store, hash-verified

11}
12
13function runSinglebar(options, limit){
14 // create new progress bar using default values
15 const bar = new _progress.Bar(options);
16 bar.start(limit, 1);
17
18 const fibonacciNumbers = [];
19
20 // calculate the Nth fibonacci
21 // this loop is executed synchronous - no timer/interval callbacks will be executed
22 for (let i = 1; i <= limit; i++) {
23 fibonacciNumbers.push(fibonacci(i));
24 bar.update(i);
25 }
26
27 bar.stop();
28
29 // display the numbers:
30 console.log('\nFibonacci (1-', fibonacciNumbers.length,'): ', fibonacciNumbers.join(', '), '\n');
31}
32
33function runMultibar(options, limit){
34 // create new progress bar using default values

Callers 1

Calls 5

fibonacciFunction · 0.85
logMethod · 0.80
startMethod · 0.45
updateMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…