UNPKG

query-registry

Version:

Query the npm registry for packuments, manifests, packages and download counts

20 lines (18 loc) 491 B
import { npmRegistryDownloadsAPI } from '../data/registries'; import { fetchFromRegistry } from './fetch-from-registry'; export async function fetchDownloadsFromRegistry<T>({ endpoint, registryDownloadsAPI = npmRegistryDownloadsAPI, cached, }: { endpoint: string; registryDownloadsAPI?: string; cached?: boolean; }): Promise<T> { return fetchFromRegistry({ endpoint, registry: registryDownloadsAPI, mirrors: [], cached, }); }