The npm
registry provides metrics on the most depended packages, but say you wanted to determine the most popular version of a given package - is that possible?
As a user, say I'm thinking of upgrading to react-router^4.0.0
, but would like to look at some adoption numbers (i.e. the number of folks running ^3.0.0
vs ^4.0.0
), is there a way to do this? Generically, say a given package has 500k downloads in the past month, I couldn't imagine they are all for foobar@latest
, so looking at a breakdown of downloads per version would seem to be useful.
Moreover, as a publisher, say I have some packages published to npm
and would like to understand which versions of these packages are the most popular with my users. Does npm
offer some type of report for this? I can't seem to find these number when I'm logged in and viewing my published items.
For npm install specific version, use npm install [package-name]@[version-number]. Use npm view [package-name] version to know the specific latest version of a package available on the npm registry. Use npm list [package-name] to know the specific latest version of an installed package.
To check the version of globally installed npm packages, run the npm list command with the -g or --global option added.
NPM exposes now a number of downloads per version.
https://www.npmjs.com/package/typescript -> click "versions"
This might not be the answer you are looking for but unfortunately it doesn't seem like that's possible. You do have a way to see total downloads and there are sites like npm-stat to show a breakdown of when downloads are happening. You might be able to infer from when releases happen for specific packages to get an idea of how many downloads that version has.
It's worth mentioning npm's article on how download counts work though so you can't say download counts == number of people who did npm install
Another, although rather extreme, option is you could try and search for JSON files that have the react-router and see the dependencies. I was hoping to see if Github or SearchCode had filtering options for you to specify it but it only has so many filters. You could probably automate this though but naturally it would still not be very accurate.
Also worth mentioning there is an open issue regarding instrumenting analytics into npm CLI
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With