UNPKG

1.42 kBPlain TextView Raw
1import { DistTags } from './dist-tags';
2import { RawPackageManifest } from './raw-package-manifest';
3
4/**
5 * `RawAbbreviatedPackument` represents an abbreviated packument (package document),
6 * as returned from the registry, containing only the metadata necessary to install a package.
7 *
8 * @see {@link https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format}
9 */
10export interface RawAbbreviatedPackument {
11 /** Package name */
12 readonly name: string;
13
14 /**
15 * Timestamp of when the package was last modified
16 * in ISO 8601 format (for example, `2021-11-23T19:12:24.006Z`)
17 */
18 readonly modified: string;
19
20 /**
21 * Mapping of distribution tags to version numbers
22 *
23 * @see {@link DistTags}
24 */
25 readonly 'dist-tags': DistTags;
26
27 /**
28 * Mapping of version numbers to package manifests
29 *
30 * @see {@link RawPackageManifest}
31 */
32 readonly versions: Record<
33 string,
34 Pick<
35 RawPackageManifest,
36 | 'name'
37 | 'version'
38 | 'dist'
39 | 'deprecated'
40 | 'dependencies'
41 | 'optionalDependencies'
42 | 'devDependencies'
43 | 'bundleDependencies'
44 | 'peerDependencies'
45 | 'bin'
46 | 'directories'
47 | 'engines'
48 | '_hasShrinkwrap'
49 >
50 >;
51}