diff options
author | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-03-01 21:54:41 +0100 |
---|---|---|
committer | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-03-01 21:54:41 +0100 |
commit | 6c8128f9fd5a5d0be115806c35a21b3d683df8d6 (patch) | |
tree | f46c2f6b3b9b294ff32bd75c08ccdc9e7a8cc4ef /sandbox/testAppNevena/Front/node_modules/gauge/lib/demo.js | |
parent | 2400b84e95913665da6279114168148444b8f9ab (diff) | |
parent | 7d3640f824f46490b47bd95f1c5a16644f712068 (diff) |
Merge branch 'dev' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into logo
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/gauge/lib/demo.js')
-rw-r--r-- | sandbox/testAppNevena/Front/node_modules/gauge/lib/demo.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/gauge/lib/demo.js b/sandbox/testAppNevena/Front/node_modules/gauge/lib/demo.js new file mode 100644 index 00000000..88c03cd9 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/gauge/lib/demo.js @@ -0,0 +1,45 @@ +var Gauge = require('./') +var gaugeDefault = require('./themes.js') +var onExit = require('signal-exit') + +var activeGauge + +onExit(function () { + activeGauge.disable() +}) + +var themes = gaugeDefault.getThemeNames() + +nextBar() +function nextBar () { + var themeName = themes.shift() + + console.log('Demoing output for ' + themeName) + + var gt = new Gauge(process.stderr, { + updateInterval: 50, + theme: themeName, + cleanupOnExit: false, + }) + activeGauge = gt + + var progress = 0 + + var cnt = 0 + var pulse = setInterval(function () { + gt.pulse('this is a thing that happened ' + (++cnt)) + }, 110) + var prog = setInterval(function () { + progress += 0.04 + gt.show(themeName + ':' + Math.round(progress * 1000), progress) + if (progress >= 1) { + clearInterval(prog) + clearInterval(pulse) + gt.disable() + if (themes.length) { + nextBar() + } + } + }, 100) + gt.show() +} |