| 11 | } |
| 12 | |
| 13 | function 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 | |
| 33 | function runMultibar(options, limit){ |
| 34 | // create new progress bar using default values |