query-registry
- Version 4.2.0
- Published
- 81.6 kB
- 5 dependencies
- MIT license
Install
npm i query-registry
yarn add query-registry
pnpm add query-registry
Overview
query-registry
is an API wrapper for the npm registry API.
Example 1
Get the metadata about the npm registry itself, if available:
import { getRegistryMetadata } from "query-registry";
const metadata = await getRegistryMetadata();
Example 2
Get the public signing keys for the npm registry:
import { getRegistrySigningKeys } from "query-registry";
const { keys } = await getRegistrySigningKeys();
Example 3
Get the abbreviated packument containing only the necessary data to install the react
package:
import { getAbbreviatedPackument } from "query-registry";
const abbrPackument = await getAbbreviatedPackument("react");
Example 4
Get the full packument containing all the data available about the react
package:
import { getPackument } from "query-registry";
const packument = await getPackument("react");
Example 5
Get the manifest containing the original package.json
data plus additional registry metadata for the latest
version of the react
package:
import { getPackageManifest } from "query-registry";
const manifest = await getPackageManifest("react");
Example 6
Get the manifest for react@18.2.0
(semver version):
import { getPackageManifest } from "query-registry";
const manifest = await getPackageManifest("react", "18.2.0");
Example 7
Get the manifest for react@next
(distribution tag):
import { getPackageManifest } from "query-registry";
const manifest = await getPackageManifest("react", "next");
Example 8
Search packages related to react
(e.g., react
, react-dom
, ...):
import { searchPackages } from "query-registry";
const results = await searchPackages({ text: "react" });
Example 9
Get the total number of downloads for package react
for the last month:
import { getPackageDownloads } from "query-registry";
const { downloads } = await getPackageDownloads("react", "last-month");
There are also these other download counts functions available: getBulkDailyPackageDownloads
, getBulkPackageDownloads
, getDailyPackageDownloads
, getDailyRegistryDownloads
and getPackageVersionsDownloads
.
Example 10
Clear the internal cache.
import { cache } from "query-registry";
cache.clear();
See the quick-lru package for the cache API.
Index
Variables
- AbbreviatedPackument
- BulkDailyPackageDownloads
- BulkPackageDownloads
- DailyPackageDownloads
- DailyRegistryDownloads
- DownloadPeriod
- npmRegistryDownloadsApiUrl
- npmRegistryUrl
- PackageDownloads
- PackageManifest
- PackageVersionsDownloads
- Packument
- RegistryDownloads
- RegistryMetadata
- RegistrySigningKeys
- SearchCriteria
- SearchResults
Functions
- getAbbreviatedPackument()
- getBulkDailyPackageDownloads()
- getBulkPackageDownloads()
- getDailyPackageDownloads()
- getDailyRegistryDownloads()
- getPackageDownloads()
- getPackageManifest()
- getPackageVersionsDownloads()
- getPackument()
- getRegistryDownloads()
- getRegistryMetadata()
- getRegistrySigningKeys()
- searchPackages()
Type Aliases
Variables
variable AbbreviatedPackument
const AbbreviatedPackument: z.ZodObject< { name: z.ZodString; modified: z.ZodString; 'dist-tags': z.ZodObject< { latest: z.ZodString; next: z.ZodOptional<z.ZodString>; alpha: z.ZodOptional<z.ZodString>; beta: z.ZodOptional<z.ZodString>; rc: z.ZodOptional<z.ZodString>; canary: z.ZodOptional<z.ZodString>; dev: z.ZodOptional<z.ZodString>; }, z.core.$catchall<z.ZodString> >; versions: z.ZodRecord< z.ZodString, z.ZodObject< { hasInstallScript: z.ZodOptional<z.ZodBoolean>; dist: z.ZodObject< { tarball: z.ZodString; shasum: z.ZodString; integrity: z.ZodOptional<z.ZodString>; fileCount: z.ZodOptional<z.ZodNumber>; unpackedSize: z.ZodOptional<z.ZodNumber>; 'npm-signature': z.ZodOptional<z.ZodString>; signatures: z.ZodOptional< z.ZodArray< z.ZodObject< { keyid: z.ZodString; sig: z.ZodString }, z.core.$strip > > >; }, z.core.$strip >; _hasShrinkwrap: z.ZodOptional<z.ZodBoolean>; engines: z.ZodCatch< z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>> >; deprecated: z.ZodOptional< z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]> >; name: z.ZodString; version: z.ZodString; bin: z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodRecord<z.ZodString, z.ZodString> ] > >; directories: z.ZodOptional< z.ZodRecord<z.ZodString, z.ZodString> >; dependencies: z.ZodOptional< z.ZodRecord<z.ZodString, z.ZodString> >; devDependencies: z.ZodOptional< z.ZodRecord<z.ZodString, z.ZodString> >; peerDependencies: z.ZodOptional< z.ZodRecord<z.ZodString, z.ZodString> >; peerDependenciesMeta: z.ZodOptional< z.ZodRecord< z.ZodString, z.ZodObject<{ optional: z.ZodBoolean }, z.core.$strip> > >; bundleDependencies: z.ZodOptional< z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]> >; optionalDependencies: z.ZodOptional< z.ZodRecord<z.ZodString, z.ZodString> >; os: z.ZodOptional<z.ZodArray<z.ZodString>>; cpu: z.ZodOptional<z.ZodArray<z.ZodString>>; }, z.core.$strip > >; }, z.core.$strip>;
variable BulkDailyPackageDownloads
const BulkDailyPackageDownloads: z.ZodRecord< z.ZodString, z.ZodUnion< readonly [ z.ZodNull, z.ZodObject< { package: z.ZodString; start: z.ZodString; end: z.ZodString; downloads: z.ZodArray< z.ZodObject< { downloads: z.ZodNumber; day: z.ZodString }, z.core.$strip > >; }, z.core.$strip > ] >>;
variable BulkPackageDownloads
const BulkPackageDownloads: z.ZodRecord< z.ZodString, z.ZodUnion< readonly [ z.ZodNull, z.ZodObject< { package: z.ZodString; downloads: z.ZodNumber; start: z.ZodString; end: z.ZodString; }, z.core.$strip > ] >>;
variable DailyPackageDownloads
const DailyPackageDownloads: z.ZodObject< { package: z.ZodString; start: z.ZodString; end: z.ZodString; downloads: z.ZodArray< z.ZodObject<{ downloads: z.ZodNumber; day: z.ZodString }, z.core.$strip> >; }, z.core.$strip>;
variable DailyRegistryDownloads
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>;
variable DownloadPeriod
const DownloadPeriod: z.ZodUnion< readonly [ z.ZodLiteral<'last-day' | 'last-week' | 'last-month' | 'last-year'>, z.ZodString ]>;
variable npmRegistryDownloadsApiUrl
const npmRegistryDownloadsApiUrl: string;
Base URL for the npm registry downloads API.
variable npmRegistryUrl
const npmRegistryUrl: string;
Base URL for the npm registry API.
variable PackageDownloads
const PackageDownloads: z.ZodObject< { package: z.ZodString; downloads: z.ZodNumber; start: z.ZodString; end: z.ZodString; }, z.core.$strip>;
variable PackageManifest
const PackageManifest: z.ZodObject< { _id: z.ZodString; dist: z.ZodObject< { tarball: z.ZodString; shasum: z.ZodString; integrity: z.ZodOptional<z.ZodString>; fileCount: z.ZodOptional<z.ZodNumber>; unpackedSize: z.ZodOptional<z.ZodNumber>; 'npm-signature': z.ZodOptional<z.ZodString>; signatures: z.ZodOptional< z.ZodArray< z.ZodObject< { keyid: z.ZodString; sig: z.ZodString }, z.core.$strip > > >; }, z.core.$strip >; readme: z.ZodOptional<z.ZodString>; readmeFilename: z.ZodOptional<z.ZodString>; gitHead: z.ZodOptional<z.ZodString>; _hasShrinkwrap: z.ZodOptional<z.ZodBoolean>; _nodeVersion: z.ZodOptional<z.ZodString>; _npmVersion: z.ZodOptional<z.ZodString>; _npmUser: z.ZodOptional< z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { name: z.ZodString; email: z.ZodOptional<z.ZodString>; url: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > > >; _npmOperationalInternal: z.ZodOptional< z.ZodObject< { host: z.ZodOptional<z.ZodString>; tmp: z.ZodOptional<z.ZodString>; }, z.core.$strip > >; engines: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>; license: z.ZodCatch<z.ZodOptional<z.ZodString>>; homepage: z.ZodCatch<z.ZodOptional<z.ZodString>>; deprecated: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>; type: z.ZodCatch<z.ZodOptional<z.ZodLiteral<'module' | 'commonjs'>>>; name: z.ZodString; version: z.ZodString; description: z.ZodOptional<z.ZodString>; keywords: z.ZodOptional<z.ZodArray<z.ZodString>>; bugs: z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { url: z.ZodOptional<z.ZodString>; email: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > >; author: z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { name: z.ZodString; email: z.ZodOptional<z.ZodString>; url: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > >; contributors: z.ZodOptional< z.ZodArray< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { name: z.ZodString; email: z.ZodOptional<z.ZodString>; url: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > > >; maintainers: z.ZodOptional< z.ZodArray< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { name: z.ZodString; email: z.ZodOptional<z.ZodString>; url: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > > >; funding: z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { url: z.ZodString; type: z.ZodOptional<z.ZodString> }, z.core.$strip >, z.ZodArray< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { url: z.ZodString; type: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > > ] > >; files: z.ZodOptional<z.ZodArray<z.ZodString>>; exports: z.ZodOptional< z.ZodUnion< readonly [ z.ZodNull, z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnknown> ] > >; main: z.ZodOptional<z.ZodString>; browser: z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodRecord< z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]> > ] > >; bin: z.ZodOptional< z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]> >; man: z.ZodOptional< z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> >; directories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; repository: z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { type: z.ZodString; url: z.ZodString; directory: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > >; scripts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; devDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; peerDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; peerDependenciesMeta: z.ZodOptional< z.ZodRecord< z.ZodString, z.ZodObject<{ optional: z.ZodBoolean }, z.core.$strip> > >; bundleDependencies: z.ZodOptional< z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]> >; bundledDependencies: z.ZodOptional< z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]> >; optionalDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; os: z.ZodOptional<z.ZodArray<z.ZodString>>; cpu: z.ZodOptional<z.ZodArray<z.ZodString>>; libc: z.ZodOptional<z.ZodString>; devEngines: z.ZodOptional< z.ZodObject< { cpu: z.ZodOptional< z.ZodUnion< readonly [ z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral<'ignore' | 'warn' | 'error'> >; }, z.core.$strip >, z.ZodArray< z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral< 'ignore' | 'warn' | 'error' > >; }, z.core.$strip > > ] > >; os: z.ZodOptional< z.ZodUnion< readonly [ z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral<'ignore' | 'warn' | 'error'> >; }, z.core.$strip >, z.ZodArray< z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral< 'ignore' | 'warn' | 'error' > >; }, z.core.$strip > > ] > >; libc: z.ZodOptional< z.ZodUnion< readonly [ z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral<'ignore' | 'warn' | 'error'> >; }, z.core.$strip >, z.ZodArray< z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral< 'ignore' | 'warn' | 'error' > >; }, z.core.$strip > > ] > >; runtime: z.ZodOptional< z.ZodUnion< readonly [ z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral<'ignore' | 'warn' | 'error'> >; }, z.core.$strip >, z.ZodArray< z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral< 'ignore' | 'warn' | 'error' > >; }, z.core.$strip > > ] > >; packageManager: z.ZodOptional< z.ZodUnion< readonly [ z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral<'ignore' | 'warn' | 'error'> >; }, z.core.$strip >, z.ZodArray< z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral< 'ignore' | 'warn' | 'error' > >; }, z.core.$strip > > ] > >; }, z.core.$strip > >; private: z.ZodOptional<z.ZodBoolean>; publishConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>; module: z.ZodOptional<z.ZodString>; types: z.ZodOptional<z.ZodString>; typings: z.ZodOptional<z.ZodString>; typesVersions: z.ZodOptional< z.ZodRecord< z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>> > >; packageManager: z.ZodOptional<z.ZodString>; sideEffects: z.ZodOptional< z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]> >; imports: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, z.core.$strip>;
variable PackageVersionsDownloads
const PackageVersionsDownloads: z.ZodObject< { package: z.ZodString; downloads: z.ZodRecord<z.ZodString, z.ZodNumber> }, z.core.$strip>;
variable Packument
const Packument: z.ZodObject< { _id: z.ZodString; name: z.ZodString; 'dist-tags': z.ZodObject< { latest: z.ZodString; next: z.ZodOptional<z.ZodString>; alpha: z.ZodOptional<z.ZodString>; beta: z.ZodOptional<z.ZodString>; rc: z.ZodOptional<z.ZodString>; canary: z.ZodOptional<z.ZodString>; dev: z.ZodOptional<z.ZodString>; }, z.core.$catchall<z.ZodString> >; time: z.ZodObject< { created: z.ZodString; modified: z.ZodString }, z.core.$catchall<z.ZodString> >; versions: z.ZodRecord< z.ZodString, z.ZodObject< { _id: z.ZodString; dist: z.ZodObject< { tarball: z.ZodString; shasum: z.ZodString; integrity: z.ZodOptional<z.ZodString>; fileCount: z.ZodOptional<z.ZodNumber>; unpackedSize: z.ZodOptional<z.ZodNumber>; 'npm-signature': z.ZodOptional<z.ZodString>; signatures: z.ZodOptional< z.ZodArray< z.ZodObject< { keyid: z.ZodString; sig: z.ZodString }, z.core.$strip > > >; }, z.core.$strip >; readme: z.ZodOptional<z.ZodString>; readmeFilename: z.ZodOptional<z.ZodString>; gitHead: z.ZodOptional<z.ZodString>; _hasShrinkwrap: z.ZodOptional<z.ZodBoolean>; _nodeVersion: z.ZodOptional<z.ZodString>; _npmVersion: z.ZodOptional<z.ZodString>; _npmUser: z.ZodOptional< z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { name: z.ZodString; email: z.ZodOptional<z.ZodString>; url: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > > >; _npmOperationalInternal: z.ZodOptional< z.ZodObject< { host: z.ZodOptional<z.ZodString>; tmp: z.ZodOptional<z.ZodString>; }, z.core.$strip > >; engines: z.ZodCatch< z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>> >; license: z.ZodCatch<z.ZodOptional<z.ZodString>>; homepage: z.ZodCatch<z.ZodOptional<z.ZodString>>; deprecated: z.ZodOptional< z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]> >; type: z.ZodCatch< z.ZodOptional<z.ZodLiteral<'module' | 'commonjs'>> >; name: z.ZodString; version: z.ZodString; description: z.ZodOptional<z.ZodString>; keywords: z.ZodOptional<z.ZodArray<z.ZodString>>; bugs: z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { url: z.ZodOptional<z.ZodString>; email: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > >; author: z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { name: z.ZodString; email: z.ZodOptional<z.ZodString>; url: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > >; contributors: z.ZodOptional< z.ZodArray< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { name: z.ZodString; email: z.ZodOptional<z.ZodString>; url: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > > >; maintainers: z.ZodOptional< z.ZodArray< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { name: z.ZodString; email: z.ZodOptional<z.ZodString>; url: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > > >; funding: z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { url: z.ZodString; type: z.ZodOptional<z.ZodString>; }, z.core.$strip >, z.ZodArray< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { url: z.ZodString; type: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > > ] > >; files: z.ZodOptional<z.ZodArray<z.ZodString>>; exports: z.ZodOptional< z.ZodUnion< readonly [ z.ZodNull, z.ZodString, z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodUnknown> ] > >; main: z.ZodOptional<z.ZodString>; browser: z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodRecord< z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]> > ] > >; bin: z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodRecord<z.ZodString, z.ZodString> ] > >; man: z.ZodOptional< z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> >; directories: z.ZodOptional< z.ZodRecord<z.ZodString, z.ZodString> >; repository: z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { type: z.ZodString; url: z.ZodString; directory: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > >; scripts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; dependencies: z.ZodOptional< z.ZodRecord<z.ZodString, z.ZodString> >; devDependencies: z.ZodOptional< z.ZodRecord<z.ZodString, z.ZodString> >; peerDependencies: z.ZodOptional< z.ZodRecord<z.ZodString, z.ZodString> >; peerDependenciesMeta: z.ZodOptional< z.ZodRecord< z.ZodString, z.ZodObject<{ optional: z.ZodBoolean }, z.core.$strip> > >; bundleDependencies: z.ZodOptional< z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]> >; bundledDependencies: z.ZodOptional< z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]> >; optionalDependencies: z.ZodOptional< z.ZodRecord<z.ZodString, z.ZodString> >; overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; os: z.ZodOptional<z.ZodArray<z.ZodString>>; cpu: z.ZodOptional<z.ZodArray<z.ZodString>>; libc: z.ZodOptional<z.ZodString>; devEngines: z.ZodOptional< z.ZodObject< { cpu: z.ZodOptional< z.ZodUnion< readonly [ z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral< | 'ignore' | 'warn' | 'error' > >; }, z.core.$strip >, z.ZodArray< z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral< | 'ignore' | 'warn' | 'error' > >; }, z.core.$strip > > ] > >; os: z.ZodOptional< z.ZodUnion< readonly [ z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral< | 'ignore' | 'warn' | 'error' > >; }, z.core.$strip >, z.ZodArray< z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral< | 'ignore' | 'warn' | 'error' > >; }, z.core.$strip > > ] > >; libc: z.ZodOptional< z.ZodUnion< readonly [ z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral< | 'ignore' | 'warn' | 'error' > >; }, z.core.$strip >, z.ZodArray< z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral< | 'ignore' | 'warn' | 'error' > >; }, z.core.$strip > > ] > >; runtime: z.ZodOptional< z.ZodUnion< readonly [ z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral< | 'ignore' | 'warn' | 'error' > >; }, z.core.$strip >, z.ZodArray< z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral< | 'ignore' | 'warn' | 'error' > >; }, z.core.$strip > > ] > >; packageManager: z.ZodOptional< z.ZodUnion< readonly [ z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral< | 'ignore' | 'warn' | 'error' > >; }, z.core.$strip >, z.ZodArray< z.ZodObject< { name: z.ZodString; version: z.ZodOptional<z.ZodString>; onFail: z.ZodOptional< z.ZodLiteral< | 'ignore' | 'warn' | 'error' > >; }, z.core.$strip > > ] > >; }, z.core.$strip > >; private: z.ZodOptional<z.ZodBoolean>; publishConfig: z.ZodOptional< z.ZodRecord<z.ZodString, z.ZodUnknown> >; workspaces: z.ZodOptional<z.ZodArray<z.ZodString>>; module: z.ZodOptional<z.ZodString>; types: z.ZodOptional<z.ZodString>; typings: z.ZodOptional<z.ZodString>; typesVersions: z.ZodOptional< z.ZodRecord< z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>> > >; packageManager: z.ZodOptional<z.ZodString>; sideEffects: z.ZodOptional< z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]> >; imports: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, z.core.$strip > >; _rev: z.ZodOptional<z.ZodCoercedString<unknown>>; users: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>; readme: z.ZodOptional<z.ZodString>; readmeFilename: z.ZodOptional<z.ZodString>; license: z.ZodOptional<z.ZodString>; homepage: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; keywords: z.ZodOptional<z.ZodArray<z.ZodString>>; bugs: z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { url: z.ZodOptional<z.ZodString>; email: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > >; author: z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { name: z.ZodString; email: z.ZodOptional<z.ZodString>; url: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > >; contributors: z.ZodOptional< z.ZodArray< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { name: z.ZodString; email: z.ZodOptional<z.ZodString>; url: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > > >; maintainers: z.ZodOptional< z.ZodArray< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { name: z.ZodString; email: z.ZodOptional<z.ZodString>; url: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > > >; repository: z.ZodOptional< z.ZodUnion< readonly [ z.ZodString, z.ZodObject< { type: z.ZodString; url: z.ZodString; directory: z.ZodOptional<z.ZodString>; }, z.core.$strip > ] > >; }, z.core.$strip>;
variable RegistryDownloads
const RegistryDownloads: z.ZodObject< { downloads: z.ZodNumber; start: z.ZodString; end: z.ZodString }, z.core.$strip>;
variable RegistryMetadata
const RegistryMetadata: z.ZodObject< { db_name: z.ZodOptional<z.ZodString>; doc_count: z.ZodOptional<z.ZodNumber>; doc_del_count: z.ZodOptional<z.ZodNumber>; update_seq: z.ZodOptional<z.ZodNumber>; purge_seq: z.ZodOptional<z.ZodNumber>; compact_running: z.ZodOptional<z.ZodBoolean>; disk_size: z.ZodOptional<z.ZodNumber>; data_size: z.ZodOptional<z.ZodNumber>; instance_start_time: z.ZodOptional<z.ZodString>; disk_format_version: z.ZodOptional<z.ZodNumber>; committed_update_seq: z.ZodOptional<z.ZodNumber>; compacted_seq: z.ZodOptional<z.ZodNumber>; uuid: z.ZodOptional<z.ZodString>; other: z.ZodOptional< z.ZodObject<{ data_size: z.ZodOptional<z.ZodNumber> }, z.core.$strip> >; sizes: z.ZodOptional< z.ZodObject< { file: z.ZodOptional<z.ZodNumber>; active: z.ZodOptional<z.ZodNumber>; external: z.ZodOptional<z.ZodNumber>; }, z.core.$strip > >; }, z.core.$strip>;
variable RegistrySigningKeys
const RegistrySigningKeys: z.ZodObject< { keys: z.ZodArray< z.ZodObject< { expires: z.ZodNullable<z.ZodString>; keyid: z.ZodString; keytype: z.ZodString; scheme: z.ZodString; key: z.ZodString; }, z.core.$strip > >; }, z.core.$strip>;
variable SearchCriteria
const SearchCriteria: z.ZodObject< { text: z.ZodString; size: z.ZodOptional<z.ZodNumber>; from: z.ZodOptional<z.ZodNumber>; quality: z.ZodOptional<z.ZodNumber>; popularity: z.ZodOptional<z.ZodNumber>; maintenance: z.ZodOptional<z.ZodNumber>; }, z.core.$strip>;
variable SearchResults
const SearchResults: z.ZodObject< { objects: z.ZodArray< z.ZodObject< { package: z.ZodObject< { date: z.ZodString; publisher: z.ZodOptional< z.ZodObject< { username: z.ZodString; email: z.ZodString }, z.core.$strip > >; maintainers: z.ZodArray< z.ZodObject< { username: z.ZodString; email: z.ZodString }, z.core.$strip > >; links: z.ZodObject< { npm: z.ZodOptional<z.ZodString>; homepage: z.ZodOptional<z.ZodString>; repository: z.ZodOptional<z.ZodString>; bugs: z.ZodOptional<z.ZodString>; }, z.core.$strip >; name: z.ZodString; version: z.ZodString; description: z.ZodOptional<z.ZodString>; keywords: z.ZodOptional<z.ZodArray<z.ZodString>>; }, z.core.$strip >; score: z.ZodObject< { final: z.ZodNumber; detail: z.ZodObject< { quality: z.ZodNumber; popularity: z.ZodNumber; maintenance: z.ZodNumber; }, z.core.$strip >; }, z.core.$strip >; searchScore: z.ZodNumber; downloads: z.ZodObject< { monthly: z.ZodNumber; weekly: z.ZodNumber }, z.core.$strip >; dependents: z.ZodCoercedNumber<unknown>; updated: z.ZodString; flags: z.ZodObject< { insecure: z.ZodCoercedBoolean<unknown>; unstable: z.ZodOptional<z.ZodCoercedBoolean<unknown>>; }, z.core.$strip >; license: z.ZodOptional<z.ZodString>; }, z.core.$strip > >; total: z.ZodNumber; time: z.ZodString; }, z.core.$strip>;
Functions
function getAbbreviatedPackument
getAbbreviatedPackument: ( name: string, registry?: string) => Promise<AbbreviatedPackument>;
getAbbreviatedPackument
returns the abbreviated packument (package document) containing only the metadata necessary to install a package.Parameter name
package name
Parameter registry
URL of the registry (default: npm registry)
Remarks
To get all the metadata (full packument) about a package see getPackument.
See Also
function getBulkDailyPackageDownloads
getBulkDailyPackageDownloads: ( names: [string, string, ...string[]], period: DownloadPeriod, registry?: string) => Promise<BulkDailyPackageDownloads>;
getBulkDailyPackageDownloads
returns the total number of downloads for each day for some packages in the given time period.Parameter names
list of package names; the npm registry does not support scoped packages and handles a maximum of 128 packages at a time
Parameter period
time period in which downloads happened; the npm registry limits bulk data to the last 365 days
Parameter registry
URL of the registry downloads API (default: npm registry downloads API)
See Also
function getBulkPackageDownloads
getBulkPackageDownloads: ( names: [string, string, ...string[]], period: DownloadPeriod, registry?: string) => Promise<BulkPackageDownloads>;
getBulkPackageDownloads
returns the total number of downloads for the given packages in the given time period.Parameter names
list of package names; the npm registry does not support scoped packages and handles a maximum of 128 packages at a time
Parameter period
time period in which downloads happened; the npm registry limits bulk data to the last 365 days
Parameter registry
URL of the registry downloads API (default: npm registry downloads API)
See Also
function getDailyPackageDownloads
getDailyPackageDownloads: ( name: string, period: DownloadPeriod, registry?: string) => Promise<DailyPackageDownloads>;
getDailyPackageDownloads
returns the total number of downloads for each day for a package in the given time period.Parameter name
package name
Parameter period
time period in which downloads happened; the npm registry limits data to the last 18 months
Parameter registry
URL of the registry downloads API (default: npm registry downloads API)
See Also
function getDailyRegistryDownloads
getDailyRegistryDownloads: ( period: DownloadPeriod, registry?: string) => Promise<DailyRegistryDownloads>;
getDailyRegistryDownloads
returns the total number of downloads for each day for all packages in the registry in the given time period.Parameter period
time period in which downloads happened; the npm registry limits data to the last 18 months
Parameter registry
URL of the registry downloads API (default: npm registry downloads API)
See Also
function getPackageDownloads
getPackageDownloads: ( name: string, period: DownloadPeriod, registry?: string) => Promise<PackageDownloads>;
getPackageDownloads
returns the total number of downloads for a package in the given time period.Parameter name
package name
Parameter period
time period in which downloads happened; the npm registry limits data to the last 18 months
Parameter registry
URL of the registry downloads API (default: npm registry downloads API)
See Also
function getPackageManifest
getPackageManifest: ( name: string, versionOrTag?: string, registry?: string) => Promise<PackageManifest>;
getPackageManifest
returns the manifest describing a specific version of a package (e.g.,foo@1.0.0
).Parameter name
package name
Parameter versionOrTag
semver version number (e.g.,
1.0.0
) or distribution tag (e.g.,latest
) (default:latest
)Parameter registry
URL of the registry (default: npm registry)
See Also
function getPackageVersionsDownloads
getPackageVersionsDownloads: ( name: string, registry?: string) => Promise<PackageVersionsDownloads>;
getPackageVersionsDownloads
returns the total number of downloads for each version of a package in the previous 7 days.Parameter name
package name
Parameter registry
URL of the registry downloads API (default: npm registry downloads API)
See Also
function getPackument
getPackument: (name: string, registry?: string) => Promise<Packument>;
getPackument
returns the full packument (package document) containing all the metadata available about a package.Parameter name
package name
Parameter registry
URL of the registry (default: npm registry)
Remarks
To get only the metadata needed to install a package (abbreviated packument) see getAbbreviatedPackument.
See Also
function getRegistryDownloads
getRegistryDownloads: ( period: DownloadPeriod, registry?: string) => Promise<RegistryDownloads>;
getRegistryDownloads
returns the total number of downloads for all packages in the registry in the given time period.Parameter period
time period in which downloads happened; the npm registry limits data to the last 18 months
Parameter registry
URL of the registry downloads API (default: npm registry downloads API)
See Also
function getRegistryMetadata
getRegistryMetadata: (registry?: string) => Promise<RegistryMetadata>;
getRegistryMetadata
returns the metadata describing the registry itself.Parameter registry
URL of the registry (default: npm registry)
See Also
function getRegistrySigningKeys
getRegistrySigningKeys: (registry?: string) => Promise<RegistrySigningKeys>;
getRegistrySigningKeys
returns the public signing keys used by the registry.Parameter registry
URL of the registry (default: npm registry)
See Also
function searchPackages
searchPackages: ( criteria: z.infer< z.ZodObject< { text: z.ZodString; size: z.ZodOptional<z.ZodNumber>; from: z.ZodOptional<z.ZodNumber>; quality: z.ZodOptional<z.ZodNumber>; popularity: z.ZodOptional<z.ZodNumber>; maintenance: z.ZodOptional<z.ZodNumber>; }, z.core.$strip > >, registry?: string) => Promise<SearchResults>;
searchPackages
returns the packages corresponding to a given query.Parameter criteria
one or more search criteria
Parameter registry
URL of the registry (default: npm registry)
See Also
Type Aliases
type AbbreviatedPackument
type AbbreviatedPackument = z.infer<typeof AbbreviatedPackument>;
AbbreviatedPackument
(package document) describes the minimal metadata needed for installing a package.See Also
type BulkDailyPackageDownloads
type BulkDailyPackageDownloads = z.infer<typeof BulkDailyPackageDownloads>;
BulkDailyPackageDownloads
describes the total number of downloads for each day for some packages in a given time period.See Also
type BulkPackageDownloads
type BulkPackageDownloads = z.infer<typeof BulkPackageDownloads>;
BulkPackageDownloads
describes the total number of downloads for some packages in a given time period.See Also
type DailyPackageDownloads
type DailyPackageDownloads = z.infer<typeof DailyPackageDownloads>;
DailyPackageDownloads
describes the total number of downloads for each day for a package in a given time period.See Also
type DailyRegistryDownloads
type DailyRegistryDownloads = z.infer<typeof DailyRegistryDownloads>;
DailyRegistryDownloads
describes the total number of downloads for each day for all packages in the registry in a given time period.See Also
type DownloadPeriod
type DownloadPeriod = /** Last day available, not necessarily yesterday. */ | 'last-day' /** Last seven days available. */ | 'last-week' /** Last 30 days available. */ | 'last-month' /** Last 365 days available. */ | 'last-year' /** Date in the format `YYYY-MM-DD`. */ | `${number}-${number}-${number}` /** Inclusive date range in the format `YYYY-MM-DD:YYYY-MM-DD`. */ | `${number}-${number}-${number}:${number}-${number}-${number}`;
DownloadPeriod
represents a time period for which downloads should be counted.The following time periods are supported by npm: -
last-day
- Last day available, not necessarily yesterday. -last-week
- Last seven days available. -last-month
- Last 30 days available. -last-year
- Last 365 days available. -YYYY-MM-DD
- Date in the formatYYYY-MM-DD
. -YYYY-MM-DD:YYYY-MM-DD
- Inclusive date range in the formatYYYY-MM-DD:YYYY-MM-DD
.See Also
type PackageDownloads
type PackageDownloads = z.infer<typeof PackageDownloads>;
PackageDownloads
describes the total number of downloads for a package in a given time period.See Also
type PackageManifest
type PackageManifest = z.infer<typeof PackageManifest>;
PackageManifest
describes the manifest for a specific version of a package (e.g.,foo@1.0.0
).Remarks
The manifest contains data extracted from
package.json
as well as data generated by the registry.See Also
type PackageVersionsDownloads
type PackageVersionsDownloads = z.infer<typeof PackageVersionsDownloads>;
PackageVersionsDownloads
describes the total number of downloads for each version of a package in the previous 7 days.See Also
type Packument
type Packument = z.infer<typeof Packument>;
Packument
(package document) describes the full metadata available about a package.See Also
type RegistryDownloads
type RegistryDownloads = z.infer<typeof RegistryDownloads>;
RegistryDownloads
describes the total number of downloads for all packages in the registry in a given time period.See Also
type RegistryMetadata
type RegistryMetadata = z.infer<typeof RegistryMetadata>;
RegistryMetadata
describes the metadata describing the registry itself.See Also
type RegistrySigningKeys
type RegistrySigningKeys = z.infer<typeof RegistrySigningKeys>;
RegistrySigningKeys
describes the signing keys used by the registry.See Also
type SearchCriteria
type SearchCriteria = z.infer<typeof SearchCriteria>;
SearchCriteria
describes the available search criteria for searching packages.See Also
type SearchResults
type SearchResults = z.infer<typeof SearchResults>;
SearchResults
describes the results returned by the registry for a search query.See Also
Package Files (16)
- dist/download-period.d.ts
- dist/get-abbreviated-packument.d.ts
- dist/get-bulk-daily-package-downloads.d.ts
- dist/get-bulk-package-downloads.d.ts
- dist/get-daily-package-downloads.d.ts
- dist/get-daily-registry-downloads.d.ts
- dist/get-package-downloads.d.ts
- dist/get-package-manifest.d.ts
- dist/get-package-versions-downloads.d.ts
- dist/get-packument.d.ts
- dist/get-registry-downloads.d.ts
- dist/get-registry-metadata.d.ts
- dist/get-registry-signing-keys.d.ts
- dist/index.d.ts
- dist/npm-registry.d.ts
- dist/search-packages.d.ts
Dependencies (5)
Dev Dependencies (11)
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/query-registry
.
- Markdown[](https://www.jsdocs.io/package/query-registry)
- HTML<a href="https://www.jsdocs.io/package/query-registry"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 5099 ms. - Missing or incorrect documentation? Open an issue for this package.