[Bug] Pagination for dependent packages limited to 11 pages #128448
-
For now, it's impossible to get all dependents for packages because pagination limited to 11 pages. Let's take source-map for example. We can see 2371 dependents on the package page. If we will follow dependend page we can see pagination. async function getAllDependents(packageName) {
const packages = []
let offset = 0
let json
do {
const response = await fetch(`https://www.npmjs.com/browse/depended/${packageName}?offset=${offset}`, {
"headers": {
"x-spiferack": "1"
},
});
json = await response.json()
offset += json.paginationSize
packages.push(...json.packages)
} while (json.hasNext)
return packages
} Let's run in it:
But we got: 396 items (11 pages × 36 item) If we will try to set offset by hand we will have |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 2 replies
-
hey @7rulnik thanks for opening this issue, I'm bringing it up with the registry / website engineering team. |
Beta Was this translation helpful? Give feedback.
hey @7rulnik thanks for opening this issue, I'm bringing it up with the registry / website engineering team.