Socket
Socket
Sign inDemoInstall

status-bar

Package Overview
Dependencies
1
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

4

lib/index.js

@@ -54,4 +54,4 @@ "use strict";

if (s === undefined) return "--:--";
if (s >= 86400000) return " > 1d";
if (s >= 3600000) return " > 1h";
if (s >= 86400) return " > 1d";
if (s >= 3600) return " > 1h";
var str;

@@ -58,0 +58,0 @@ var min = ~~(s/60);

{
"name": "status-bar",
"version": "1.1.0",
"version": "1.1.1",
"description": "A status bar for file transfers",

@@ -5,0 +5,0 @@ "keywords": ["status", "bar", "file", "transfer", "speed", "progress",

@@ -52,2 +52,37 @@ status-bar

#### Download example ####
```javascript
var http = require ("http");
var statusBar = require ("status-bar");
var url = "http://nodejs.org/dist/latest/node.exe";
http.get (url, function (res){
var bar = statusBar.create ({
total: res.headers["content-length"],
render: function (stats){
process.stdout.write (
url + " " +
this.format.storage (stats.currentSize) + " " +
this.format.speed (stats.speed) + " " +
this.format.time (stats.remainingTime) + " [" +
this.format.progressBar (stats.percentage) + "] " +
this.format.percentage (stats.percentage));
process.stdout.cursorTo (0);
}
});
res.pipe (bar);
}).on ("error", function (error){
console.error (error);
});
```
Prints something similar to this:
```
http://nodejs.org/dist/latest/node.exe 2.7 MiB 502.4K/s 00:07 [############············] 49%
```
#### Render function examples ####

@@ -54,0 +89,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc