| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 4x 4x 2x 2x 2x 2x | import fetch from 'node-fetch';
export default async (registry, name) => {
const response = await fetch(`${registry}${name}`);
if (!response.ok) {
const error = new Error(`Could Not Get Package: ${registry}${name}`);
error.status = response.status;
throw error;
}
return response.json();
};
|