query-registry
Version:
Query the npm registry for packuments, manifests, packages and download counts
27 lines (24 loc) • 1.17 kB
TypeScript
import * as z from "zod";
import type { DownloadPeriod } from "./download-period.js";
export declare const DailyRegistryDownloads: z.ZodObject<{
start: z.ZodString;
end: z.ZodString;
downloads: z.ZodArray<z.ZodObject<{
downloads: z.ZodNumber;
day: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
/**
`DailyRegistryDownloads` describes the total number of downloads for each day
for all packages in the registry in a given time period.
@see {@link https://github.com/npm/registry/blob/master/docs/download-counts.md#ranges}
*/
export type DailyRegistryDownloads = z.infer<typeof DailyRegistryDownloads>;
/**
`getDailyRegistryDownloads` returns the total number of downloads for each day
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 DailyRegistryDownloads}
*/
export declare function getDailyRegistryDownloads(period: DownloadPeriod, registry?: string): Promise<DailyRegistryDownloads>;