UNPKG

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