NpmPackageRepo

See if npm package repo is forked from others

Penulis
junyu-404
Pemasangan harian
0
Total pemasangan
2
Nilai
0 0 0
Versi
0.1.0
Dibuat
27 September 2022
Diperbarui
27 September 2022
Lisensi
MIT
Berlaku untuk

Feature

Add a badge icon to show the npm package forks info:

  • If the package repo isn't forked from other repo, show the forks number
  • If the package repo is forked from other repo, show this repo and its parent repo forks number
  • If the package repo is not found, show status 404

Install directly with Tampermonkey

package repo isn't forked from other repo

package repo is fored from other repo

package repo is not found

Note

To use this script, you need to allow cross-origin, Tampermonkey will pop a page like this:

screenshot about cross-origin request

You can always remove or update the settings in script setting tab if you want.

screenshot about change script setting

Limitation

According to Github API document[^1]:

For unauthenticated requests, the rate limit allows for up to 60 requests per hour. Unauthenticated requests are associated with the originating IP address, and not the person making requests.

Known Issues to Fix

When you nagtive to other package from the search suggestion result as your current location is a package detail page, the badge will not changed. (Issue #8)

Background

When I search npm packages, find some packages are forked from other repo, and doesn't put infomation to indicate but is pulished to public. I know some forks repo maybe add more featrue based on the original package, but I think is confused if there is nothing to indicate this and also doesn't respcet the original developer, since the packages published to npm and we can't see the info like we see the fork repo in Github.

Thanks Badgen to easily generate the badges.

[^1]: Rate Limiting from Resources in the REST API - Gihub Docs