UNPKG

1.41 kBTypeScriptView Raw
1import { AbbreviatedPackument } from '../types/abbreviated-packument';
2/**
3 * `getAbbreviatedPackument` returns the abbreviated packument (package document)
4 * containing only the metadata necessary to install a package present on the registry.
5 *
6 * @remarks
7 * To get all the metadata (full packument) about a package see {@link getPackument}.
8 *
9 * @param name - package name
10 * @param registry - URL of the registry (default: npm registry)
11 * @param mirrors - URLs of the registry mirrors (default: npm registry mirrors)
12 * @param cached - accept cached responses (default: `true`)
13 *
14 * @example
15 * Get the abbreviated packument for package `query-registry` from the npm registry:
16 *
17 * ```typescript
18 * import { getAbbreviatedPackument } from 'query-registry';
19 *
20 * (async () => {
21 * const packument = await getAbbreviatedPackument({ name: 'query-registry' });
22 *
23 * // Output: 'query-registry'
24 * console.log(packument.name);
25 * })();
26 * ```
27 *
28 * @see {@link AbbreviatedPackument}
29 * @see {@link RawAbbreviatedPackument}
30 * @see {@link npmRegistry}
31 * @see {@link npmRegistryMirrors}
32 */
33export declare function getAbbreviatedPackument({ name, registry, mirrors, cached, }: {
34 name: string;
35 registry?: string;
36 mirrors?: string[];
37 cached?: boolean;
38}): Promise<AbbreviatedPackument>;
39//# sourceMappingURL=get-abbreviated-packument.d.ts.map
\No newline at end of file