query-registry
Version:
Query the npm registry for packuments, manifests, packages and download counts
24 lines (21 loc) • 1.02 kB
TypeScript
import * as z from "zod";
import type { DownloadPeriod } from "./download-period.js";
export declare const RegistryDownloads: z.ZodObject<{
downloads: z.ZodNumber;
start: z.ZodString;
end: z.ZodString;
}, z.core.$strip>;
/**
`RegistryDownloads` describes the total number of downloads
for all packages in the registry in a given time period.
@see {@link https://github.com/npm/registry/blob/master/docs/download-counts.md#point-values}
*/
export type RegistryDownloads = z.infer<typeof RegistryDownloads>;
/**
`getRegistryDownloads` returns the total number of downloads
for all packages in the registry in the given time period.
@param period - {@link DownloadPeriod | time period} in which downloads happened; the npm registry limits data to the last 18 months
@param registry - URL of the registry downloads API (default: npm registry downloads API)
@see {@link RegistryDownloads}
*/
export declare function getRegistryDownloads(period: DownloadPeriod, registry?: string): Promise<RegistryDownloads>;