(name, pos)
| 3 | |
| 4 | // helper function to display preset |
| 5 | function showPreset(name, pos){ |
| 6 | console.log(_colors.magenta('Preset: ' + name)); |
| 7 | |
| 8 | // create a new progress bar with preset |
| 9 | const bar = new _progress.Bar({ |
| 10 | align: pos |
| 11 | }, _progress.Presets[name] || _progress.Presets.legacy); |
| 12 | bar.start(200, 0); |
| 13 | |
| 14 | // random value 1..200 |
| 15 | bar.update(Math.floor((Math.random() * 200) + 1)); |
| 16 | bar.stop(); |
| 17 | console.log(''); |
| 18 | } |
| 19 | |
| 20 | console.log(''); |
| 21 | showPreset('legacy', 'center'); |
no test coverage detected
searching dependent graphs…