-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: #4049 Credit: @wraithgar Close: #4049 Reviewed-by: @fritzy
- Loading branch information
Showing
41 changed files
with
955 additions
and
216 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- This file is automatically added by @npmcli/template-oss. Do not edit. --> | ||
|
||
ISC License | ||
|
||
Copyright npm, Inc. | ||
|
||
Permission to use, copy, modify, and/or distribute this | ||
software for any purpose with or without fee is hereby | ||
granted, provided that the above copyright notice and this | ||
permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL | ||
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO | ||
EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, | ||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER | ||
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE | ||
USE OR PERFORMANCE OF THIS SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.