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

use registry.npmjs.org #1697

Merged
merged 1 commit into from
Sep 30, 2024
Merged

use registry.npmjs.org #1697

merged 1 commit into from
Sep 30, 2024

Conversation

mbostock
Copy link
Member

This switches from data.jsdelivr.com (which is currently down) to registry.npmjs.org (which is the ground truth) to resolve npm package versions. It also seems to be quite a bit faster.

@mbostock mbostock requested a review from Fil September 30, 2024 05:10
let promise = npmVersionRequests.get(href);
if (promise) return promise; // coalesce concurrent requests
promise = (async function () {
const input = formatNpmSpecifier({name, range});
process.stdout.write(`npm:${input} ${faint("→")} `);
const response = await fetch(href);
const response = await fetch(href, {...(!disttag && {headers: {Accept: "application/vnd.npm.install-v1+json"}})});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbostock mbostock merged commit 0ca16ce into main Sep 30, 2024
4 checks passed
@mbostock mbostock deleted the mbostock/npm-registry branch September 30, 2024 15:03
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

Successfully merging this pull request may close these issues.

2 participants