-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Badge request: dependents of a npm package #1845
Comments
The API doesn't match the number on the npm site. See chrisdickinson/npm-get-dependents#3. I confirmed that through my own experimentation with the endpoint it uses on the legacy npm registry mirror. (https://skimdb.npmjs.com/registry/_design/app/_view/dependedUpon) Scraping npmjs is a nice solution, and more server capacity would enable that. See my proposal at #1742 (comment) and some actionable work in #1848. I have an implementation using Libraries.io, which we've used elsewhere. (#1895) That API is on the slow side, but it works, and may be an acceptable option for the time being. |
I can work on this. |
I just learned about npms! We could base this on their API. |
|
Though it's not explicitly called out in the npms API docs, the API response does include a value for dependents count in https://api.npms.io/v2/package/got {
"analyzedAt":"2019-10-19T11:32:46.782Z",
"collected":{
"metadata":{ .. },
"npm":{
"downloads":[ .. ],
"dependentsCount":2349,
"starsCount":124
},
"github":{ .. },
"source":{ .. }
},
"evaluation":{ .. },
"score":{ .. }
} However, I think the same issue exists here relative to the counts being off. The registry shows (at the time of this post) 2,844 dependents for got whereas the API response from npms shows 2,349 |
Probably worth keeping tabs on npms-io/npms#37 over in the npms repo to see if there's an explanation for the descrepancy |
Would be nice to have a badge to show off how many npm packages depend on my package. For example, the
1717 Dependents
number at https://www.npmjs.com/package/got.You could either:
The text was updated successfully, but these errors were encountered: