
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
npm-stats-cli
Advanced tools
A command line interface for npm registry statistics and insights, with flexible output methods (JSON, CSV, TSV and ASCII chart), as well as daily, monthly and yearly aggregation granularities.
A command line interface for npm registry statistics and insights, either per user or per package.
It supports flexible outputs, such as JSON, ASCII chart, CSV and TSV. Also, it can aggregate the data on daily, monthly and yearly levels.
You can install npm-stats-cli as a global package in the usual way:
$ npm install npm-stats-cli -g


By typing
$ npm-stats --help
you can display the complete list of possible flags:
npm-stats usage:
--------------------------
Arguments:
--package <packageName> The package name to gather statistics from.
--user <userName> The name of the NPM registry user to gather statistics from.
This will generate statistics for all public modules of the user.
--by-package This can be used to gather user-level statistics by package name.
--granularity <granularity> The level of aggregation ('daily', 'monthly', 'yearly'). Default is 'monthly'.
--output <type> How the statistics should be generated ('json', 'chart', 'csv', 'tsv'). Default is 'json'.
--start <startDate> The start date (in 'YYYY-MM-DD' format).
--end <endDate> The end date (in 'YYYY-MM-DD' format).
--registry-url The URL of the registry endpoint, including the protocol. Default is 'https://registry.npmjs.org'.
--api-url The URL of the registry API endpoint, including the protocol. Default is 'https://api.npmjs.org'.
Hints:
Either --package or --user flags are mandatory. If neither --start or --end is specified,
the data from yesterday will be used.
$ npm-stats --user tobilg
This will output the download statistics of all of the user tobilg's packages from yesterday, aggregated to monthly level, and output as JSON.
{"years":{"2017":{"downloads":25,"months":{"12":{"downloads":25}}}}}
$ npm-stats --user tobilg --granularity daily --output tsv
This will output the download statistics of all of the user tobilg's packages from yesterday, aggregated to daily level, and output as TSV.
year month day downloads
2017 12 29 25
$ npm-stats --user tobilg --granularity daily --output tsv --by-package
This will output the download statistics of all of the user tobilg's packages from yesterday (on package level), aggregated to daily level, and output as TSV.
year month day package downloads
2017 12 29 buffered-queue 1
2017 12 29 ceph-admin-ops-client 0
2017 12 29 facebook-events-by-location 0
2017 12 29 facebook-events-by-location-core 11
2017 12 29 fs2obj 8
2017 12 29 kafka-node-slim 0
2017 12 29 marathon-event-bus-client 0
2017 12 29 marathon-event-bus-mock 0
2017 12 29 marathon-validate 0
2017 12 29 mesos-framework 0
2017 12 29 mesos-operator-api-client 0
2017 12 29 mesosctl 0
2017 12 29 mesosdns-cli 0
2017 12 29 mesosdns-client 0
2017 12 29 mesosdns-http-agent 0
2017 12 29 no-kafka-slim 5
The given limits of the npm registry API apply:
2015-01-10$ npm-stats --user tobilg --start 2017-12-01 --end 2017-12-05 --granularity daily --output tsv
This will output the download statistics of all of the user tobilg's packages from 2017-12-01 to 2017-12-05, aggregated to daily level, and output as TSV.
year month day downloads
2017 12 1 72
2017 12 2 39
2017 12 3 14
2017 12 4 139
2017 12 5 79
$ npm-stats --user tobilg --granularity daily --output chart --start 2017-10-01 --end 2017-11-30
This will output the download statistics of all of the user tobilg's packages from 2017-10-01 to 2017-11-30, aggregated to daily level, and output as ASCII chart.
296.00 ┤ ╭╮
277.00 ┤ ││ ╭╮
258.00 ┤ ╭╮ ││ ││
239.00 ┤ ││ ││ ││
220.00 ┤ ││ ╭╯│ ││
201.00 ┤ ││ │ │ ││
182.00 ┤ ││ │ │ │╰─╮
163.00 ┤ ╭╮ ││ │ │ │ │ ╭╮
144.00 ┤ ││╭╮ ││╭╯ │ │ │ ││
125.00 ┤ │││╰╮ │││ │╭╮╭╮ │ │ ╭╮ ╭╯│ ╭╮ ╭╮
106.00 ┼╮│╰╯ │ │││ │││││ ╭╮│ ╰╮╭╮ ││╭╯ ╰╮ ╭╮││ ╭╯╰╮
87.00 ┤││ ╰╮│╰╯ ││││╰─╯╰╯ ╰╯│ │╰╯ │ ╭╮ ╭─╮ ╭╯│││ ╭╯ │
68.00 ┤╰╯ ││ ││╰╯ │ │ │ ││╭╮ │ ╰╮ ╭╯ ╰╯│ │ ╰╮
49.00 ┤ ││ ││ │ │ │ │╰╯│ ╭─╯ │ │ │ │ │
30.00 ┤ ╰╯ ││ ╰─╯ ╰─╯ │ │ │ │ │ │ ╰
11.00 ┤ ╰╯ ╰──╯ ╰─╯ ╰─╯
The --by-package flag is enabled automatically by default, so it doesn't need to be specified.
$ npm-stats --package axios
This will output the download statistics of the axios package from yesterday, aggregated to monthly level, and output as JSON.
{"years":{"2017":{"downloads":75897,"months":{"12":{"downloads":75897,"packages":{"axios":{"downloads":75897}}}}}}}
The other options and possibilities are the same as for the user-level statistics (see above).
FAQs
A command line interface for npm registry statistics and insights, with flexible output methods (JSON, CSV, TSV and ASCII chart), as well as daily, monthly and yearly aggregation granularities.
We found that npm-stats-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.