Determine most popular version of a given npm package?

后端 未结 3 1738
无人及你
无人及你 2021-02-13 14:24

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?

3条回答
  •  温柔的废话
    2021-02-13 15:05

    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

提交回复
热议问题