1.4.1 • Published 4 years ago

npmtotal v1.4.1

Weekly downloads
38
License
ISC
Repository
github
Last release
4 years ago

npmtotal

Find your npm download statistics by author or packages, can be used as a CLI or Module

Installation

npm i npmtotal -g

or

npm i npmtotal when consuming as a module

Usage

CLI

For npm author

npx npmtotal --author authorName

and for npm packages

npx npmtotal --packages package1 package2 ...

Module

const npmtotal = require("npmtotal");

// author
(async () => {
  console.log(await npmtotal("maddhruv"));
})();

// packages
(async () => {
  console.log(await npmtotal(["npmtotal", "post-merge-install"]));
})();

The returned object is of this structure.

{
  stats: [
    [String(packageName), Number(downloads)]
  ],
  sum: Number(totalDownloads)
}

Options

You can pass several options as the second param.

OptionDescriptionDefault value
excludean array of packages to exclude[]
startDatestart date for counting downloadstoday - 1 year
endDateend date for counting downloadstoday

You can also pass startDate and endDate as options to the CLI

npx npmtotal --author maddhruv --startDate '2020-01-01' --endDate '2020-01-03'

Related

  • npm-statistics - NPM Download Stats updated daily with badge and readme update