()
| 16 | } |
| 17 | |
| 18 | function Example5(){ |
| 19 | console.log(''); |
| 20 | // create new progress bar |
| 21 | const b1 = new _progress.Bar({ |
| 22 | format: myFormatter, |
| 23 | barCompleteChar: '\u2588', |
| 24 | barIncompleteChar: '\u2591', |
| 25 | hideCursor: true, |
| 26 | stopOnComplete: true |
| 27 | }); |
| 28 | |
| 29 | // initialize the bar - defining payload token "speed" with the default value "N/A" |
| 30 | b1.start(200, 0, { |
| 31 | task: 'Task 1' |
| 32 | }); |
| 33 | |
| 34 | // 20ms update rate |
| 35 | const timer = setInterval(function(){ |
| 36 | // increment value |
| 37 | b1.increment(); |
| 38 | |
| 39 | // finished ? |
| 40 | if (b1.isActive === false){ |
| 41 | clearInterval(timer); |
| 42 | } |
| 43 | }, 20); |
| 44 | } |
| 45 | |
| 46 | Example5(); |
no test coverage detected
searching dependent graphs…