UNPKG

3.82 kBTypeScriptView Raw
1import { BugTracker } from './bug-tracker';
2import { Person } from './person';
3import { Repository } from './repository';
4/**
5 * `PackageJSON` contains the package metadata
6 * usually found in `package.json` files.
7 *
8 * @remarks
9 * For some packages, especially legacy ones,
10 * the properties may be mistyped due to incorrect data present on the registry.
11 *
12 * @see {@link https://docs.npmjs.com/cli/v6/configuring-npm/package-json}
13 */
14export interface PackageJSON {
15 /** Package name */
16 readonly name: string;
17 /** Package version number */
18 readonly version: string;
19 /** Package description */
20 readonly description?: string;
21 /** Homepage URL */
22 readonly homepage?: string;
23 /** SPDX license identifier */
24 readonly license?: string;
25 /** Text of the license */
26 readonly licenseText?: string;
27 /** Keywords describing the package */
28 readonly keywords?: string[];
29 /**
30 * Author of the package
31 *
32 * @see {@link Person}
33 */
34 readonly author?: Person;
35 /**
36 * Maintainers of the package
37 *
38 * @see {@link Person}
39 */
40 readonly maintainers?: Person[];
41 /**
42 * Contributors to the package
43 *
44 * @see {@link Person}
45 */
46 readonly contributors?: Person[];
47 /**
48 * Repository containing the package's source
49 *
50 * @see {@link Repository}
51 */
52 readonly repository?: string | Repository;
53 /**
54 * Bug tracker
55 *
56 * @see {@link BugTracker}
57 */
58 readonly bugs?: BugTracker;
59 /** Runtime dependencies */
60 readonly dependencies?: Record<string, string>;
61 /** Development dependencies */
62 readonly devDependencies?: Record<string, string>;
63 /** Peer dependencies */
64 readonly peerDependencies?: Record<string, string>;
65 /** Optional dependencies */
66 readonly optionalDependencies?: Record<string, string>;
67 /** Bundled dependencies */
68 readonly bundleDependencies?: string[];
69 /** Bundled dependencies (alias) */
70 readonly bundledDependencies?: string[];
71 /** Main source file */
72 readonly source?: string;
73 /** Main file (Node) */
74 readonly main?: string;
75 /** Main file (Browser) */
76 readonly browser?: string;
77 /** Main file (Modules) */
78 readonly module?: string;
79 /** Type declarations file */
80 readonly types?: string;
81 /** Type declarations file (alias) */
82 readonly typings?: string;
83 /**
84 * Export map
85 *
86 * @see {@link https://nodejs.org/api/packages.html#packages_subpath_exports}
87 */
88 readonly exports?: string | Record<string, unknown>;
89 /** File patterns included in the package */
90 readonly files?: string[];
91 /** Executable files */
92 readonly bin?: string | Record<string, string>;
93 /** Man pages */
94 readonly man?: string | string[];
95 /** Directories describing the package's structure */
96 readonly directories?: Record<string, string>;
97 /** npm scripts */
98 readonly scripts?: Record<string, string>;
99 /** npm config */
100 readonly config?: Record<string, string>;
101 /** Node compatibility */
102 readonly engines?: Record<string, string>;
103 /** OS compatibility */
104 readonly os?: string[];
105 /** CPU compatibility */
106 readonly cpu?: string[];
107 /** Prevent publishing */
108 readonly private?: boolean;
109 /** Publishing configuration */
110 readonly publishConfig?: Record<string, string>;
111 /** Deprecation message */
112 readonly deprecated?: string;
113 /** README contents */
114 readonly readme?: string;
115 /** Name of the README file */
116 readonly readmeFilename?: string;
117 /** Other fields */
118 readonly [key: string]: unknown;
119}
120//# sourceMappingURL=package-json.d.ts.map
\No newline at end of file