ts-progress
Advanced tools
Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "ts-progress", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Flexible node progress bar.", | ||
@@ -41,6 +41,5 @@ "main": "progress.js", | ||
"dependencies": { | ||
"charm": "^1.0.1", | ||
"numeral": "^1.5.3" | ||
"charm": "^1.0.1" | ||
}, | ||
"devDependencies": "" | ||
} |
'use strict'; | ||
var numeral = require('numeral'); | ||
var charm = require('charm')(); | ||
@@ -63,12 +62,12 @@ charm.pipe(process.stdout); | ||
this.renderElapsed = function (color) { | ||
_this.renderItem(numeral(_this._elapsed).format('0.0') + 's', color); | ||
_this.renderItem(_this._elapsed.toFixed(1) + "s", color); | ||
}; | ||
this.renderRemaining = function (color) { | ||
_this.renderItem(numeral(_this._remaining).format('0.0') + 's', color); | ||
_this.renderItem(_this._remaining.toFixed(1) + "s", color); | ||
}; | ||
this.renderMemory = function (color) { | ||
_this.renderItem(numeral(process.memoryUsage().rss / 1024 / 1024).format('0.0') + 'M', color); | ||
_this.renderItem((process.memoryUsage().rss / 1024 / 1024).toFixed(1) + "M", color); | ||
}; | ||
this.renderPercent = function (color) { | ||
_this.renderItem(numeral(_this._percent).format('0') + "%", color); | ||
_this.renderItem(_this._percent.toFixed(0) + "%", color); | ||
}; | ||
@@ -118,6 +117,8 @@ this.renderCurrent = function (color) { | ||
this.renderText = function (text) { | ||
if (_this._textColor) | ||
if (_this._textColor) { | ||
charm.display('bright').foreground(_this._textColor).write(text).display('reset'); | ||
else | ||
} | ||
else { | ||
charm.display('bright').write(text).display('reset'); | ||
} | ||
}; | ||
@@ -138,3 +139,3 @@ this.renderTitle = function () { | ||
/** | ||
* Creates new progress bar object | ||
* Creates new progress object | ||
* @param options | ||
@@ -141,0 +142,0 @@ * @returns {Progress} |
1
231
12757
- Removednumeral@^1.5.3
- Removednumeral@1.5.6(transitive)