Gathering detailed insights and metrics for downloads
Gathering detailed insights and metrics for downloads
Gathering detailed insights and metrics for downloads
Gathering detailed insights and metrics for downloads
npm install downloads
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
4 Stars
16 Commits
3 Forks
2 Watching
1 Branches
2 Contributors
Updated on 15 Jul 2019
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
0%
6
Compared to previous day
Last week
37.1%
48
Compared to previous week
Last month
-27.2%
174
Compared to previous month
Last year
-17.5%
3,905
Compared to previous year
5
3
Retrieve npm download stats for the specified repository or maintainer.
Install with npm:
1$ npm install --save downloads
1var downloads = require('downloads');
Retieve the download stats for the specified repository. The results are an array of download object that contain the day
and downloads
count for that day: [{day: '2016-11-12', downloads: 12345}]
. This method will also emit a repo
event on the downloads
object when the downloads are available.
Example
1downloads.repo('micromatch', function(err, results) { 2 if (err) return console.error(err); 3 console.log(results); 4}); 5//=> [ 6//=> { day: '2016-11-12', downloads: 94699 }, 7//=> { day: '2016-11-11', downloads: 264382 }, 8//=> { day: '2016-11-10', downloads: 309356 }, 9//=> { day: '2016-11-09', downloads: 290557 }, 10//=> { day: '2016-11-08', downloads: 316004 }, 11//=> ... 12//=> ]
Params
name
{String}: Name of the repository to get download counts for.options
{Object}: Additional options.cb
{Function}: Optional callback function to get the results. If not provided, a promise is returned.returns
{Promise}: If no callback function is provided, a promise is returned that will yield the results array.Events
emits
: repo
Emits repo
event when downloads are available. Emits the repo name and download count array.Retrieve the download stats for all of the repositories maintained by the specified maintainer. The results are an object where the key is the repository name and the value is an array of download counts. This is the same array returned by the repo method. This method will also emit a repos
event when the repos
have been retrieved for the maintainer and a maintainer
event when all of the downloads have been retrieved and the final results object is available.
Example
1downloads.maintainer('doowb', function(err, results) { 2 if (err) return console.error(err); 3 console.log(results); 4}); 5//=> { 6//=> "add-collaborator": [...], 7//=> "accountdown-token": [...], 8//=> "add-banner": [...], 9//=> "align-text": [...], 10//=> "JSONStream": [...], 11//=> "anchors": [...], 12//=> "announcement": [...], 13//=> ... 14//=> }
Params
name
{String}: Name of the maintainer to retrieve download counts for.options
{Object}: Additional options to control how the downloads are gathered.options.limit
{Number}: Specify how many repositories can be processed concurrently. Defaults to 1.cb
{Function}: Optional callback function to get the results. If not provied, a promise is returned.returns
{Promise}: If no callback function is provied, a promise is returned that with yield the results object.Events
emits
: repos
Emits repos
event when the maintainers repositories have been retrieved. Emits the maintainer name and the repository array.emits
: repo
Emits repo
event for each repository after the repository's download counts are available.emits
: maintainer
Emits maintainer
event when all of the download counts for all of the maintainer's repositories are available.npm-api: Base class for retrieving data from the npm registry. | homepage
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guide for avice on opening issues, pull requests, and coding standards.
(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)
To generate the readme and API documentation with verb:
1$ npm install -g verb verb-generate-readme && verb
Install dev dependencies:
1$ npm install -d && npm test
Brian Woodward
Copyright © 2016, Brian Woodward. Released under the MIT license.
This file was generated by verb-generate-readme, v0.2.0, on November 13, 2016.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
Found 0/16 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-11-25
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