ts-progress
Advanced tools
Comparing version 0.0.10 to 0.1.0
{ | ||
"name": "ts-progress", | ||
"version": "0.0.10", | ||
"version": "0.1.0", | ||
"description": "Flexible node progress bar for Windows/macOS/Linux.", | ||
@@ -5,0 +5,0 @@ "main": "progress.js", |
@@ -43,3 +43,2 @@ 'use strict'; | ||
this.write = function () { | ||
//charm.up(1).erase('line').write("\r"); | ||
var match; | ||
@@ -112,6 +111,8 @@ while (match = _this._regex.exec(_this._pattern)) { | ||
this.renderItem = function (item, color) { | ||
if (color) | ||
if (color) { | ||
charm.foreground(color).write(item).display('reset'); | ||
else | ||
} | ||
else { | ||
charm.write(item); | ||
} | ||
}; | ||
@@ -132,2 +133,14 @@ this.renderText = function (text) { | ||
}; | ||
this.skipStep = function () { | ||
if (_this._updateFrequency == 0) | ||
return false; | ||
var elapsed = _this._now - _this._cycle; | ||
if (elapsed < _this._updateFrequency) { | ||
return true; | ||
} | ||
else { | ||
_this._cycle = _this._now; | ||
return false; | ||
} | ||
}; | ||
this._padding = new Array(300).join(' '); | ||
@@ -181,14 +194,2 @@ if (pattern) | ||
}; | ||
Progress.prototype.skipStep = function () { | ||
if (this._updateFrequency == 0) | ||
return false; | ||
var elapsed = this._now - this._cycle; | ||
if (elapsed < this._updateFrequency) { | ||
return true; | ||
} | ||
else { | ||
this._cycle = this._now; | ||
return false; | ||
} | ||
}; | ||
return Progress; | ||
@@ -195,0 +196,0 @@ }()); |
@@ -22,11 +22,6 @@ interface ProgressOptions{ | ||
declare module "ts-progress"{ | ||
var progress: { | ||
let progress: { | ||
/** | ||
* @deprecated use Progress.create(options: IProgressOptions) | ||
*/ | ||
new (total: number, pattern?: string, textColor?: string, title?: string, updateFrequency?: number): Progress; | ||
/** | ||
* Creates new progress bar object | ||
* @param options {IProgressOptions} | ||
* @param options {ProgressOptions} | ||
* @returns {Progress} | ||
@@ -33,0 +28,0 @@ */ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15049
274