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

Function showPreset

examples/example-presets.js:5–16  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

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

Callers 1

example-presets.jsFile · 0.70

Calls 4

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…