isEnabled
method to allow introspection of the gauge's
"enabledness" as controlled by .enable()
and .disable()
.enable
/disable
if the gauge
is already enabled or disabled respectively. This prevents leaking event
listeners, amongst other weirdness.enabled
only if we have a tty. Users can always override
this by passing in the enabled
option explicitly or by calling calling
gauge.enable()
../console-strings.js
into console-control-strings
.signal-exit@3.0.0
, which fixes a compatibility bug with the
node profiler.Themeset.getThemeNames
).gauge.hide()
as it is somtetimes necessary when
your terminal is interleaving output from multiple filehandles (ie, stdout
& stderr).hasUnicode
, hasColor
and
platform
keys in order to override our guesses as to those values when
selecting a default theme from the themeset.process.stderr
now).setWriteTo(stream[, tty])
to change the output stream and,
optionally, tty.signal-exit
in our deps. <.< Thank you @KenanY for
finding this. Then I was lazy and made a new commit instead of using his
PR. Again, thank you for your patience @KenenY.has-color
module proved too magic for my needs, making assumptions
as to which stream we write to and reading command line arguments.This is a major rewrite of the internals. Externally there are fewer changes:
show
it may wate up to updateInterval
ms before it
actually prints an update. You override this behavior with the
fixedFramerate
option.ansi
ified stream, although it can be if you want (but we won't make
use of its special features).process.stdout
wasn't a
tty. Now it always defaults to enabled. If you want the previous
behavior set the enabled
option to process.stdout.isTTY
.Themes are entirely different. If you were using a custom theme, or
referring to one directly (eg via Gauge.unicode
or Gauge.ascii
) then
you'll need to change your code. You can get the equivalent of the latter
with:
var themes = require('gauge/themes')
var unicodeTheme = themes(true, true) // returns the color unicode theme for your platform
The default themes no longer use any ambiguous width characters, so even if you choose to display those as wide your progress bar should still display correctly.
Templates are entirely different and if you were using a custom one, you should consult the documentation to learn how to recreate it. If you were using the default, be aware that it has changed and the result looks quite a bit different.