query-registry
Version:
Query the npm registry for packuments, manifests, packages and download counts
22 lines (19 loc) • 911 B
TypeScript
import * as z from "zod";
export declare const PackageVersionsDownloads: z.ZodObject<{
package: z.ZodString;
downloads: z.ZodRecord<z.ZodString, z.ZodNumber>;
}, z.core.$strip>;
/**
`PackageVersionsDownloads` describes the total number of downloads
for each version of a package in the previous 7 days.
@see {@link https://github.com/npm/registry/blob/master/docs/download-counts.md#per-version-download-counts}
*/
export type PackageVersionsDownloads = z.infer<typeof PackageVersionsDownloads>;
/**
`getPackageVersionsDownloads` returns the total number of downloads
for each version of a package in the previous 7 days.
@param name - package name
@param registry - URL of the registry downloads API (default: npm registry downloads API)
@see {@link PackageVersionsDownloads}
*/
export declare function getPackageVersionsDownloads(name: string, registry?: string): Promise<PackageVersionsDownloads>;