Installations
npm install @adouming/request-progress
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
16.13.2
NPM Version
8.3.2
Score
71.7
Supply Chain
91.8
Quality
75.3
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
IndigoUnited
Download Statistics
Total Downloads
790
Last Day
4
Last Week
4
Last Month
26
Last Year
250
GitHub Statistics
217 Stars
85 Commits
19 Forks
7 Watching
19 Branches
10 Contributors
Bundle Size
1.88 kB
Minified
811.00 B
Minified + Gzipped
Package Meta Information
Latest Version
3.0.1
Package Id
@adouming/request-progress@3.0.1
Unpacked Size
23.30 kB
Size
5.35 kB
File Count
8
NPM Version
8.3.2
Node Version
16.13.2
Total Downloads
Cumulative downloads
Total Downloads
790
Last day
300%
4
Compared to previous day
Last week
-20%
4
Compared to previous week
Last month
36.8%
26
Compared to previous month
Last year
14.7%
250
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
request-progress
Tracks the download progress of a request made with request, giving insight of various metrics including progress percentage, download speed and time remaining.
Installation
$ npm install request-progress
Usage
1var fs = require('fs'); 2var request = require('request'); 3var progress = require('request-progress'); 4 5// The options argument is optional so you can omit it 6progress(request('https://az412801.vo.msecnd.net/vhd/VMBuild_20141027/VirtualBox/IE11/Windows/IE11.Win8.1.For.Windows.VirtualBox.zip'), { 7 // throttle: 2000, // Throttle the progress event to 2000ms, defaults to 1000ms 8 // delay: 1000, // Only start to emit after 1000ms delay, defaults to 0ms 9 // lengthHeader: 'x-transfer-length' // Length header to use, defaults to content-length 10}) 11.on('progress', function (state) { 12 // The state is an object that looks like this: 13 // { 14 // percent: 0.5, // Overall percent (between 0 to 1) 15 // speed: 554732, // The download speed in bytes/sec 16 // size: { 17 // total: 90044871, // The total payload size in bytes 18 // transferred: 27610959 // The transferred payload size in bytes 19 // }, 20 // time: { 21 // elapsed: 36.235, // The total elapsed seconds since the start (3 decimals) 22 // remaining: 81.403 // The remaining seconds to finish (3 decimals) 23 // } 24 // } 25 console.log('progress', state); 26}) 27.on('error', function (err) { 28 // Do something with err 29}) 30.on('end', function () { 31 // Do something after request finishes 32}) 33.pipe(fs.createWriteStream('IE11.Win8.1.For.Windows.VirtualBox.zip'));
If the request's response does not include the content-length
header, the values of some metrics will be null
.
Also speed
and time.remaining
will be null
until it can be calculated.
The state
object emitted in the progress
event is reused to avoid creating a new object for each event.
If you wish to peek the state
object at any time, it is available in request.progressState
.
Tests
$ npm test
$ npm test-cov
to get coverage report
License
Released under the MIT License.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 5/29 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 6 are checked with a SAST tool
Score
3.2
/10
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More