New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ts-progress

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-progress - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

index.js

10

example.js

@@ -1,15 +0,15 @@

//import {Progress} from './progress';
'use strict';
var Progress = require('./progress');
var items = 10;
var interval = 250;
var interval = 100;
function withDefaultSettings() {
var progress = new Progress(items);
var progress = Progress.create({ total: items });
run(progress, withPattern);
}
function withPattern() {
var progress = new Progress(items, 'Progress: {bar} | Elapsed: {elapsed} | Remaining: {remaining} | {percent} | {current}/{total}');
var progress = Progress.create({ total: items, pattern: 'Progress: {bar} | Elapsed: {elapsed} | Remaining: {remaining} | {percent} | {current}/{total}' });
run(progress, withPatternAndColors);
}
function withPatternAndColors() {
var progress = new Progress(items, 'Progress: {bar.white.cyan.25} | Elapsed: {elapsed.green} | Remaining: {remaining.blue} | {percent.magenta} | {current.red}/{total.yellow}');
var progress = Progress.create({ total: items, pattern: 'Progress: {bar.white.cyan.25} | Elapsed: {elapsed.green} | Remaining: {remaining.blue} | {percent.magenta} | {current.red}/{total.yellow}' });
run(progress);

@@ -16,0 +16,0 @@ }

{
"name": "ts-progress",
"version": "0.0.4",
"version": "0.0.5",
"description": "Flexible node progress bar.",

@@ -5,0 +5,0 @@ "main": "progress.js",

@@ -1,2 +0,2 @@

"use strict";
'use strict';
var numeral = require('numeral');

@@ -6,2 +6,6 @@ var charm = require('charm')();

var Progress = (function () {
/**
*
* @deprecated use Progress.create(options: IProgressOptions)
*/
function Progress(_total, pattern, _textColor, _title, _updateFrequency) {

@@ -132,2 +136,10 @@ var _this = this;

}
/**
* Creates new progress bar object
* @param options
* @returns {Progress}
*/
Progress.create = function (options) {
return new Progress(options.total, options.pattern, options.textColor, options.title, options.updateFrequency | 0);
};
Progress.prototype.update = function () {

@@ -163,3 +175,4 @@ this._now = new Date().getTime();

exports.Progress = Progress;
//export = Progress
module.exports = Progress;
//# sourceMappingURL=progress.js.map

@@ -19,3 +19,3 @@ # ts-progress

var progress = new Progress(total);
var progress = Progress.create({total: total});

@@ -42,12 +42,12 @@ var iv = setInterval(function () {

// with default options
var progress = new Progress(50);
var progress = Progress.create({total: 50});
// with pattern
var progress = new Progress(50, 'Progress: {bar} | Remaining: {remaining} | {percent} ');
var progress = Progress.create({total: 50, pattern: 'Progress: {bar} | Remaining: {remaining} | {percent} '});
//with pattern and text color
var progress = new Progress(50, 'Progress: {current}/{total} | Remaining: {remaining} | Elapsed: {elapsed} ', 'blue');
var progress = Progress.create({total: 50, pattern: 'Progress: {current}/{total} | Remaining: {remaining} | Elapsed: {elapsed} ', textColor: 'blue'});
//with default options and title
var progress = new Progress(50, undefined, undefined, 'Waiting for results');
var progress = Progress.create({total: 50, title: 'Waiting for results'});

@@ -66,3 +66,3 @@ ```

var progress = new Progress(total, undefined, undefined, undefined, 150);
var progress = Progress.create({total: total, updateFrequency: 150});

@@ -100,3 +100,3 @@ var iv = setInterval(function () {

```javascript
var progress = new Progress(50, 'Progress: {bar.white.red.10} | Remaining: {remaining.red} | {percent.blue}');
var progress = Progress.create({total:50, pattern: 'Progress: {bar.white.red.10} | Remaining: {remaining.red} | {percent.blue}'});
```

@@ -103,0 +103,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc