Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
BetterProgressBar.prototype.render = function (tokens) {
const str = formatEta(this.eta())
const actualFormat = this.fmt
// improve display of ETA
this.fmt = this.fmt.replace(':eta', str)
ProgressBar.prototype.render.call(this, tokens)
this.fmt = actualFormat
}
const ProgressBar = require("progress");
// Monkey patch terminate() so it doesn't throw an exception when the stream
// isn't a TTY. See: https://github.com/visionmedia/node-progress/pull/138
const terminate = ProgressBar.prototype.terminate;
ProgressBar.prototype.terminate = function() {
if (!this.stream.isTTY) {
return;
}
terminate.apply(this, arguments);
};
module.exports = ProgressBar;
const ProgressBar = require("progress");
// Monkey patch terminate() so it doesn't throw an exception when the stream
// isn't a TTY. See: https://github.com/visionmedia/node-progress/pull/138
const terminate = ProgressBar.prototype.terminate;
ProgressBar.prototype.terminate = function() {
if (!this.stream.isTTY) {
return;
}
terminate.apply(this, arguments);
};
module.exports = ProgressBar;