Skip to content
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

How to get all direct package dependants #6607

Closed
MarcoPellero opened this issue Jun 24, 2023 · 2 comments
Closed

How to get all direct package dependants #6607

MarcoPellero opened this issue Jun 24, 2023 · 2 comments

Comments

@MarcoPellero
Copy link

Hi, i'm not sure if this is the repo i should open this issue in, i couldn't find the repo for the npmjs.com site.
I'm sorry if it isn't.

I'm trying to build a tool that finds all packages that indirectly depend on a specified package, and for this, i need to be able to find all packages that directly depend on a specified package.
This can be found on npmjs.com, for any given package you can see how many packages directly depend on it, and you can browse those dependants in "pages" (36 at a time).
Example: the direct dependents of the https package

I wrote some code to read these pages from the API, but it crashed before reading all of them, and upon further inspection i noticed that both on the API and on the site itself, you can only browse the first 11 pages, so, you can see at most 396 dependents of a package, after that, the "next page" button disappears.
By the way, when i say API, i'm replicating the site's requests. If you add the x-spiferack: 1 header, you get back json instead of html.

I was wondering why this limit is in place, if it could be removed, and/or if there's any other way to read this data, maybe straight from the registry.
I tried looking at the registry but i couldn't figure out whether it was possible to get this data from there.

@MarcoPellero
Copy link
Author

For now, i hardcoded a limit to my tool so that i could still work on the rest of it while waiting to find a solution to this, but now i think i'm getting rate-limited: after a bit, requests return error code 1015, and it keeps returning only that for a while, though the site works, which is weird since i'm basically doing the same requests

@wraithgar
Copy link
Member

I don't believe this is possible w/ the current registry endpoints. This is a question for registry support, not an npm cli bug.

@wraithgar wraithgar closed this as not planned Won't fix, can't repro, duplicate, stale Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants