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

@vbarbarosh/node-helpers

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vbarbarosh/node-helpers - npm Package Compare versions

Comparing version 3.21.1 to 3.22.0

src/format_progress.test.js

2

package.json

@@ -5,3 +5,3 @@ {

"name": "@vbarbarosh/node-helpers",
"version": "3.21.1",
"version": "3.22.0",
"description": "A set of helpers for JavaScript/Node.js",

@@ -8,0 +8,0 @@ "files": [

const format_bytes = require('./format_bytes');
const format_percents = require('./format_percents');
const format_seconds = require('./format_seconds');
const is_number_gt = require('./is_number_gt');
function format_progress({percents, total, done, rate, eta, duration})
{
const bps = rate ? `${format_bytes(rate)}/s` : '~';
if (total) {
const eta_str = eta ? format_seconds(eta) : '~';
const bps = is_number_gt(rate, 0) ? `${format_bytes(rate)}/s` : '~';
if (is_number_gt(total, 0)) {
const eta_str = is_number_gt(eta, 0) ? format_seconds(eta) : '~';
return `${format_percents(percents)} | ${format_bytes(done)} of ${format_bytes(total)} at ${bps} ETA ${eta_str} duration=${format_seconds(duration)}`;
}
return `${format_bytes(done)} of ~ at ${bps} duration=${format_seconds(duration)}`;
if (is_number_gt(done, 0)) {
return `${format_bytes(done)} of ~ at ${bps} duration=${format_seconds(duration)}`;
}
if (is_number_gt(duration, 0)) {
return `~ duration=${format_seconds(duration)}`;
}
return '~';
}
module.exports = format_progress;
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