UNPKG

9.2 kBTypeScriptView Raw
1/**
2 * A person who has been involved in creating or maintaining this package
3 */
4export interface Person
5{
6 "name": string;
7 "url"?: string;
8 "email"?: string;
9 [k: string]: any;
10}
11export type ScriptsPublishAfter = string;
12export type ScriptsInstallAfter = string;
13export type ScriptsUninstallBefore = string;
14export type ScriptsVersionBefore = string;
15export type ScriptsTest = string;
16export type ScriptsStop = string;
17export type ScriptsStart = string;
18export type ScriptsRestart = string;
19/**
20 * Dependencies are specified with a simple hash of package name to version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.
21 */
22export interface Dependency
23{
24 [k: string]: string;
25}
26export interface CoreProperties
27{
28 /**
29 * The name of the package.
30 */
31 "name"?: string;
32 /**
33 * Version must be parseable by node-semver, which is bundled with npm as a dependency.
34 */
35 "version"?: string;
36 /**
37 * This helps people discover your package, as it's listed in 'npm search'.
38 */
39 "description"?: string;
40 /**
41 * This helps people discover your package as it's listed in 'npm search'.
42 */
43 "keywords"?: string[];
44 /**
45 * The url to the project homepage.
46 */
47 "homepage"?: string;
48 /**
49 * The url to your project's issue tracker and / or the email address to which issues should be reported. These are helpful for people who encounter issues with your package.
50 */
51 "bugs"?: {
52 /**
53 * The url to your project's issue tracker.
54 */
55 "url"?: string;
56 /**
57 * The email address to which issues should be reported.
58 */
59 "email"?: string;
60 [k: string]: any;
61 };
62 /**
63 * You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you're placing on it.
64 */
65 "license"?: string;
66 /**
67 * You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you're placing on it.
68 */
69 "licenses"?: {
70 "type"?: string;
71 "url"?: string;
72 [k: string]: any;
73 }[];
74 /**
75 * A person who has been involved in creating or maintaining this package
76 */
77 "author"?: Person;
78 /**
79 * A list of people who contributed to this package.
80 */
81 "contributors"?: Person[];
82 /**
83 * A list of people who maintains this package.
84 */
85 "maintainers"?: Person[];
86 /**
87 * The 'files' field is an array of files to include in your project. If you name a folder in the array, then it will also include the files inside that folder.
88 */
89 "files"?: string[];
90 /**
91 * The main field is a module ID that is the primary entry point to your program.
92 */
93 "main"?: string;
94 "bin"?: {
95 [k: string]: string;
96 };
97 /**
98 * Specify either a single file or an array of filenames to put in place for the man program to find.
99 */
100 "man"?: any[] | string;
101 "directories"?: {
102 /**
103 * If you specify a 'bin' directory, then all the files in that folder will be used as the 'bin' hash.
104 */
105 "bin"?: string;
106 /**
107 * Put markdown files in here. Eventually, these will be displayed nicely, maybe, someday.
108 */
109 "doc"?: string;
110 /**
111 * Put example scripts in here. Someday, it might be exposed in some clever way.
112 */
113 "example"?: string;
114 /**
115 * Tell people where the bulk of your library is. Nothing special is done with the lib folder in any way, but it's useful meta info.
116 */
117 "lib"?: string;
118 /**
119 * A folder that is full of man pages. Sugar to generate a 'man' array by walking the folder.
120 */
121 "man"?: string;
122 "test"?: string;
123 [k: string]: any;
124 };
125 /**
126 * Specify the place where your code lives. This is helpful for people who want to contribute.
127 */
128 "repository"?: {
129 "type"?: string;
130 "url"?: string;
131 [k: string]: any;
132 };
133 /**
134 * The 'scripts' member is an object hash of script commands that are run at various times in the lifecycle of your package. The key is the lifecycle event, and the value is the command to run at that point.
135 */
136 "scripts"?: {
137 /**
138 * Run BEFORE the package is published (Also run on local npm install without any arguments)
139 */
140 "prepublish"?: string;
141 /**
142 * Run AFTER the package is published
143 */
144 "publish"?: ScriptsPublishAfter;
145 /**
146 * Run AFTER the package is published
147 */
148 "postpublish"?: ScriptsPublishAfter;
149 /**
150 * Run BEFORE the package is installed
151 */
152 "preinstall"?: string;
153 /**
154 * Run AFTER the package is installed
155 */
156 "install"?: ScriptsInstallAfter;
157 /**
158 * Run AFTER the package is installed
159 */
160 "postinstall"?: ScriptsInstallAfter;
161 /**
162 * Run BEFORE the package is uninstalled
163 */
164 "preuninstall"?: ScriptsUninstallBefore;
165 /**
166 * Run BEFORE the package is uninstalled
167 */
168 "uninstall"?: ScriptsUninstallBefore;
169 /**
170 * Run AFTER the package is uninstalled
171 */
172 "postuninstall"?: string;
173 /**
174 * Run BEFORE bump the package version
175 */
176 "preversion"?: ScriptsVersionBefore;
177 /**
178 * Run BEFORE bump the package version
179 */
180 "version"?: ScriptsVersionBefore;
181 /**
182 * Run AFTER bump the package version
183 */
184 "postversion"?: string;
185 /**
186 * Run by the 'npm test' command
187 */
188 "pretest"?: ScriptsTest;
189 /**
190 * Run by the 'npm test' command
191 */
192 "test"?: ScriptsTest;
193 /**
194 * Run by the 'npm test' command
195 */
196 "posttest"?: ScriptsTest;
197 /**
198 * Run by the 'npm stop' command
199 */
200 "prestop"?: ScriptsStop;
201 /**
202 * Run by the 'npm stop' command
203 */
204 "stop"?: ScriptsStop;
205 /**
206 * Run by the 'npm stop' command
207 */
208 "poststop"?: ScriptsStop;
209 /**
210 * Run by the 'npm start' command
211 */
212 "prestart"?: ScriptsStart;
213 /**
214 * Run by the 'npm start' command
215 */
216 "start"?: ScriptsStart;
217 /**
218 * Run by the 'npm start' command
219 */
220 "poststart"?: ScriptsStart;
221 /**
222 * Run by the 'npm restart' command. Note: 'npm restart' will run the stop and start scripts if no restart script is provided.
223 */
224 "prerestart"?: ScriptsRestart;
225 /**
226 * Run by the 'npm restart' command. Note: 'npm restart' will run the stop and start scripts if no restart script is provided.
227 */
228 "restart"?: ScriptsRestart;
229 /**
230 * Run by the 'npm restart' command. Note: 'npm restart' will run the stop and start scripts if no restart script is provided.
231 */
232 "postrestart"?: ScriptsRestart;
233 [k: string]: string;
234 };
235 /**
236 * A 'config' hash can be used to set configuration parameters used in package scripts that persist across upgrades.
237 */
238 "config"?: any;
239 /**
240 * Dependencies are specified with a simple hash of package name to version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.
241 */
242 "dependencies"?: Dependency;
243 /**
244 * Dependencies are specified with a simple hash of package name to version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.
245 */
246 "devDependencies"?: Dependency;
247 /**
248 * Dependencies are specified with a simple hash of package name to version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.
249 */
250 "optionalDependencies"?: Dependency;
251 /**
252 * Dependencies are specified with a simple hash of package name to version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.
253 */
254 "peerDependencies"?: Dependency;
255 "engines"?: {
256 [k: string]: string;
257 };
258 "engineStrict"?: boolean;
259 /**
260 * You can specify which operating systems your module will run on
261 */
262 "os"?: string[];
263 /**
264 * If your code only runs on certain cpu architectures, you can specify which ones.
265 */
266 "cpu"?: string[];
267 /**
268 * If your package is primarily a command-line application that should be installed globally, then set this value to true to provide a warning if it is installed locally.
269 */
270 "preferGlobal"?: boolean;
271 /**
272 * If set to true, then npm will refuse to publish it.
273 */
274 "private"?: boolean;
275 "publishConfig"?: any;
276 "dist"?: {
277 "shasum"?: string;
278 "tarball"?: string;
279 [k: string]: any;
280 };
281 "readme"?: string;
282 [k: string]: any;
283}
284export interface JspmDefinition
285{
286 "jspm"?: CoreProperties;
287 [k: string]: any;
288}
289export type BundledDependency = string[];
290export type JsonSchemaForNpmPackageJsonFiles = CoreProperties & JspmDefinition & {
291 /**
292 * Array of package names that will be bundled when publishing the package.
293 */
294 "bundleDependencies"?: BundledDependency;
295 [k: string]: any;
296} | {
297 /**
298 * Array of package names that will be bundled when publishing the package.
299 */
300 "bundledDependencies"?: BundledDependency;
301 [k: string]: any;
302} & any;
\No newline at end of file