-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Get combined badge and stats for same gh + npm package #10
Comments
We did consider doing this when designing the first API version (same problem applies to all stats endpoints, not just badges) and indeed, my idea was using the repository field from In the end we didn't do this because:
The third, and probably most important reason: We recommend that people always use npm links when possible, and as a package author you have the opportunity to put those links in the official documentation. If you do that, most of your users will just use the recommended links and the GitHub hits become so insignificant that combining them isn't necessary. |
Thank you for getting back to me. These are all fair points. Obviously, not having the Just to be clear: I was inspired in part by the ability to request multiple packages with a single request (so that idiom kinda already exists) and by #9 to think of jsDelivr as delivering a package that happens to be hosted on npm or github or somewhere else in the future-- the stats simply reflect how many times that particular code has been delivered. Feel free to close the issue if there's nothing else to consider; I'm totally fine just switching over to the npm links and ignoring the other traffic. Thanks again and thank you to the whole team for making something that's absurdly useful. |
Indeed, after your first post I considered a similar I'll close this for now and we may revisit the idea if it becomes more important in the feature. |
If I publish code on github and npm, I'd like the jsDelivr badge to report combined stats for both. (Yay vanity metrics!)
To avoid abuse (e.g., a badge that combines stats for an unknown project with the stats for an unrelated popular project), perhaps you could use the repository field in
package.json
to make the correlation. It appears that field is already extracted somewhere because it appears on the page for packages.The text was updated successfully, but these errors were encountered: