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

Function showPreset

examples/example-align.js:5–18  ·  view source on GitHub ↗
(name, pos)

Source from the content-addressed store, hash-verified

3
4// helper function to display preset
5function 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
20console.log('');
21showPreset('legacy', 'center');

Callers 1

example-align.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…