ts-progress
Advanced tools
Comparing version 0.1.7 to 0.1.8
{ | ||
"name": "ts-progress", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "Flexible node progress bar for Windows/macOS/Linux.", | ||
@@ -27,3 +27,3 @@ "main": "progress.js", | ||
}, | ||
"devDependencies": "" | ||
"devDependencies": {} | ||
} |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Progress = void 0; | ||
var charm = require('charm')(); | ||
charm.pipe(process.stdout); | ||
var Progress = /** @class */ (function () { | ||
/** | ||
* | ||
* @deprecated use Progress.create(options: ProgressOptions) | ||
*/ | ||
function Progress(_total, pattern, _textColor, _title, _updateFrequency) { | ||
@@ -63,12 +60,12 @@ if (_updateFrequency === void 0) { _updateFrequency = 0; } | ||
this.renderElapsed = function (color) { | ||
_this.renderItem(_this._elapsed.toFixed(1) + "s", color); | ||
_this.renderItem("".concat(_this._elapsed.toFixed(1), "s"), color); | ||
}; | ||
this.renderRemaining = function (color) { | ||
_this.renderItem(_this._remaining.toFixed(1) + "s", color); | ||
_this.renderItem("".concat(_this._remaining.toFixed(1), "s"), color); | ||
}; | ||
this.renderMemory = function (color) { | ||
_this.renderItem((process.memoryUsage().rss / 1024 / 1024).toFixed(1) + "M", color); | ||
_this.renderItem("".concat((process.memoryUsage().rss / 1024 / 1024).toFixed(1), "M"), color); | ||
}; | ||
this.renderPercent = function (color) { | ||
_this.renderItem(_this._percent.toFixed(0) + "%", color); | ||
_this.renderItem("".concat(_this._percent.toFixed(0), "%"), color); | ||
}; | ||
@@ -75,0 +72,0 @@ this.renderCurrent = function (color) { |
# ts-progress | ||
[![Build Status](https://travis-ci.org/agracio/ts-progress.svg?branch=master)](https://travis-ci.org/agracio/ts-progress) | ||
[![Build status](https://ci.appveyor.com/api/projects/status/wbk31bj66di1qrk5?svg=true)](https://ci.appveyor.com/project/agracio/ts-progress) | ||
[![Coverage Status](https://coveralls.io/repos/github/agracio/ts-progress/badge.svg?branch=master)](https://coveralls.io/github/agracio/ts-progress?branch=master) | ||
[![Dependencies](https://david-dm.org/agracio/ts-progress.svg)](https://david-dm.org/agracio/ts-progress#info=dependencies) | ||
> Flexible node progress bar for Windows/macOS/Linux | ||
### Flexible node progress bar for Windows/macOS/Linux | ||
![image](https://github.com/agracio/ts-progress/raw/master/screenshot.gif) | ||
@@ -49,2 +48,3 @@ | ||
## Options | ||
Progress bar accepts the following options on initialisation: | ||
@@ -106,4 +106,4 @@ * `total: number` - Total number of items to process. | ||
### Token customisation | ||
Tokens can be customised to define color for each token. | ||
Progress bar token accepts two colors for remaining/done items as well as length. | ||
Tokens can be customized to define a color for each token. | ||
Progress bar token accepts two colors for remaining/done items as well as length. | ||
@@ -121,2 +121,3 @@ Usage for all tokens except progress bar: | ||
## Colors | ||
Progress bar uses [charm](https://www.npmjs.com/package/charm) to render elements and supports charm string colors: | ||
@@ -123,0 +124,0 @@ * `red` |
@@ -1,31 +0,24 @@ | ||
interface ProgressOptions{ | ||
total: number, | ||
pattern?: string, | ||
textColor?: string, | ||
title?: string, | ||
updateFrequency?: number | ||
} | ||
declare module "ts-progress"{ | ||
interface Progress{ | ||
/** | ||
* Updates progress | ||
*/ | ||
update(); | ||
interface ProgressOptions{ | ||
total: number, | ||
pattern?: string, | ||
textColor?: string, | ||
title?: string, | ||
updateFrequency?: number | ||
} | ||
/** | ||
* Finishes progress | ||
*/ | ||
done(); | ||
} | ||
interface Progress{ | ||
/** | ||
* Updates progress | ||
*/ | ||
update(); | ||
declare module "ts-progress"{ | ||
let progress: { | ||
/** | ||
* Creates new progress bar object | ||
* @param options {ProgressOptions} | ||
* @returns {Progress} | ||
* Finishes progress | ||
*/ | ||
create(options: ProgressOptions): Progress | ||
}; | ||
export = progress; | ||
done(); | ||
} | ||
function create(options: ProgressOptions): Progress | ||
} |
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
15406
6
133
264