npm Blog (Archive)

The npm blog has been discontinued.

Updates from the npm team are now published on the GitHub Blog and the GitHub Changelog.

numeric precision matters: how npm download counts work

We pretty frequently get questions about npm’s download stats, what we count and don’t count, and whether an author’s package download numbers are “real”. I’ve given lots of piecemeal explanations of this on Twitter, but I thought I’d give the full version so we can point people at it.

npm’s download stats are naïve by design: they are simply a count of the number of HTTP 200 responses we served that were tarball files, i.e. packages. This means the number includes:

So the count of “downloads” is much larger than the number of people who typed “npm install yourpackage” on any given day. There are some mitigating factors:

Bottom line: most packages get a trickle of downloads every day, and that’s not necessarily indicative that they’re being actively used. Only if your package is getting > 50 downloads/day can you be sure you’re seeing signal instead of noise. You will also get a burst of downloads whenever you publish a new package or a version of that package, because all the mirrors will download it.
The reasons we don’t filter or discard the automated downloads are
  1. bot filtering is really hard, and never totally accurate, and requires constant manual intervention or crazy machine learning to get right, and we are not an analytics company. We’re pretty sure you’d rather we focused on npm itself rather than the website stats. Maybe when we’re bigger we’ll do more.
  2. automated traffic is relevant to some people. Lots of testing and build tool packages are downloaded as part of automation and so their usage is usefully indicated by automated downloads. So if we started filtering automated traffic we’d immediately get asked to create a separate count of “verified bot traffic” or something and it would quickly spiral out of control.

It’s much easier to say: use these numbers as directional indicators of package popularity. They are not absolute numbers, and they are definitely not the same as the number of “users” of a package.

An aside about automated downloads

Back in February we stopped allowing force-publishing of existing packages. The constant stream of automated downloads by mirrors was part of why: if you publish a package, it is immediately downloaded and copied to dozens of servers worldwide that are outside our control. Allowing you to over-write that package gave you the false sense that the old version was “gone”, or that if there was sensitive information in the package you had safely erased it. That was never true, and keeping the automated downloads in our counts helps underline that.