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

Function Example5

examples/example-formatter.js:18–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16}
17
18function 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
46Example5();

Callers 1

Calls 3

logMethod · 0.80
incrementMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…