@codeworksh/cli 0.0.1-dev.20260918042316 → 0.0.1-dev.20260922135856

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +51 -0
  2. package/add-D7X5BuCv.mjs +81 -0
  3. package/add-D7X5BuCv.mjs.map +1 -0
  4. package/{catalog-Cv1zoZ5S.mjs → catalog-DL8yWdvI.mjs} +2 -2
  5. package/{catalog-Cv1zoZ5S.mjs.map → catalog-DL8yWdvI.mjs.map} +1 -1
  6. package/check-M9CqztTk.mjs +47 -0
  7. package/check-M9CqztTk.mjs.map +1 -0
  8. package/commonjs-CiyyOsS6.mjs +160 -0
  9. package/commonjs-CiyyOsS6.mjs.map +1 -0
  10. package/definitions-ClJIBYEm.mjs +3348 -0
  11. package/definitions-ClJIBYEm.mjs.map +1 -0
  12. package/entries-DBdy6ahj.mjs +48 -0
  13. package/entries-DBdy6ahj.mjs.map +1 -0
  14. package/{error-zJGKAF4a.mjs → error-DTXBm1nO.mjs} +2348 -1841
  15. package/error-DTXBm1nO.mjs.map +1 -0
  16. package/{generate-DdscbX3w.mjs → generate-C5NElYXe.mjs} +3 -3
  17. package/{generate-DdscbX3w.mjs.map → generate-C5NElYXe.mjs.map} +1 -1
  18. package/{harness-BBTdWdhx.mjs → harness-DQxbts5f.mjs} +2 -2
  19. package/{harness-BBTdWdhx.mjs.map → harness-DQxbts5f.mjs.map} +1 -1
  20. package/index.mjs +16 -6
  21. package/index.mjs.map +1 -1
  22. package/install-CJEnZ9dx.mjs +53 -0
  23. package/install-CJEnZ9dx.mjs.map +1 -0
  24. package/lib-5d-Jmuz2.mjs +16078 -0
  25. package/lib-5d-Jmuz2.mjs.map +1 -0
  26. package/lib-CVW4jqJ3.mjs +37659 -0
  27. package/lib-CVW4jqJ3.mjs.map +1 -0
  28. package/lib-HXZBVLKt.mjs +846 -0
  29. package/lib-HXZBVLKt.mjs.map +1 -0
  30. package/lib-vrwKjvzk.mjs +10868 -0
  31. package/lib-vrwKjvzk.mjs.map +1 -0
  32. package/link-D8V3E5iZ.mjs +40 -0
  33. package/link-D8V3E5iZ.mjs.map +1 -0
  34. package/{list-C6BrwuV-.mjs → list-BMUDpLRf.mjs} +4 -4
  35. package/{list-C6BrwuV-.mjs.map → list-BMUDpLRf.mjs.map} +1 -1
  36. package/list-DS9BJ3dD.mjs +76 -0
  37. package/list-DS9BJ3dD.mjs.map +1 -0
  38. package/p-map-LZ99xLhZ.mjs +116 -0
  39. package/p-map-LZ99xLhZ.mjs.map +1 -0
  40. package/package.json +11 -8
  41. package/{providers-fO-GJuXn.mjs → providers-DT5BfXJV.mjs} +4 -4
  42. package/{providers-fO-GJuXn.mjs.map → providers-DT5BfXJV.mjs.map} +1 -1
  43. package/reload-2GZ_8UBW.mjs +26 -0
  44. package/reload-2GZ_8UBW.mjs.map +1 -0
  45. package/remove-t8FHVGC0.mjs +36 -0
  46. package/remove-t8FHVGC0.mjs.map +1 -0
  47. package/{run-CgPOJ-wJ.mjs → run-CP7aAfkf.mjs} +11 -8
  48. package/run-CP7aAfkf.mjs.map +1 -0
  49. package/{runtime-DuL-GGrx.mjs → runtime-CDSh4qOj.mjs} +108 -1
  50. package/runtime-CDSh4qOj.mjs.map +1 -0
  51. package/{serve-Du6luqoi.mjs → serve-DewC8gvV.mjs} +19 -6
  52. package/serve-DewC8gvV.mjs.map +1 -0
  53. package/settings-Bn2pmQXX.mjs +215 -0
  54. package/settings-Bn2pmQXX.mjs.map +1 -0
  55. package/type-defs-xvRvQI4T.mjs +538 -0
  56. package/type-defs-xvRvQI4T.mjs.map +1 -0
  57. package/update-CLfU-oh7.mjs +44 -0
  58. package/update-CLfU-oh7.mjs.map +1 -0
  59. package/valid-BXe5q7ao.mjs +354 -0
  60. package/valid-BXe5q7ao.mjs.map +1 -0
  61. package/error-zJGKAF4a.mjs.map +0 -1
  62. package/run-CgPOJ-wJ.mjs.map +0 -1
  63. package/runtime-DuL-GGrx.mjs.map +0 -1
  64. package/serve-Du6luqoi.mjs.map +0 -1
@@ -0,0 +1,3348 @@
1
+ import { St as __require, yt as __commonJSMin } from "./error-DTXBm1nO.mjs";
2
+ import { t as require_type_defs } from "./type-defs-xvRvQI4T.mjs";
3
+ //#region ../../node_modules/.pnpm/@npmcli+config@11.0.1/node_modules/@npmcli/config/lib/definitions/definition.js
4
+ var require_definition = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5
+ const required = [
6
+ "type",
7
+ "description",
8
+ "default",
9
+ "key"
10
+ ];
11
+ const allowed = [
12
+ "default",
13
+ "defaultDescription",
14
+ "deprecated",
15
+ "description",
16
+ "exclusive",
17
+ "flatten",
18
+ "hint",
19
+ "key",
20
+ "short",
21
+ "type",
22
+ "typeDescription",
23
+ "usage",
24
+ "envExport",
25
+ "alias",
26
+ "required"
27
+ ];
28
+ const { semver: { type: semver }, Umask: { type: Umask }, url: { type: url }, path: { type: path } } = require_type_defs();
29
+ var Definition = class {
30
+ constructor(key, def) {
31
+ this.key = key;
32
+ this.envExport = true;
33
+ Object.assign(this, def);
34
+ this.validate();
35
+ if (!this.defaultDescription) this.defaultDescription = describeValue(this.default);
36
+ if (!this.typeDescription) this.typeDescription = describeType(this.type);
37
+ if (!this.hint) {
38
+ if (this.type === Number) this.hint = "<number>";
39
+ else this.hint = `<${this.key}>`;
40
+ }
41
+ if (!this.usage) this.usage = describeUsage(this);
42
+ }
43
+ validate() {
44
+ for (const req of required) if (!Object.prototype.hasOwnProperty.call(this, req)) throw new Error(`config lacks ${req}: ${this.key}`);
45
+ if (!this.key) throw new Error(`config lacks key: ${this.key}`);
46
+ for (const field of Object.keys(this)) if (!allowed.includes(field)) throw new Error(`config defines unknown field ${field}: ${this.key}`);
47
+ }
48
+ describe() {
49
+ const description = unindent(this.description);
50
+ const noEnvExport = this.envExport ? "" : `
51
+ This value is not exported to the environment for child processes.
52
+ `;
53
+ const deprecated = !this.deprecated ? "" : `* DEPRECATED: ${unindent(this.deprecated)}\n`;
54
+ const exclusive = !this.exclusive ? "" : `\nThis config cannot be used with: \`${this.exclusive.join("`, `")}\``;
55
+ return wrapAll(`#### \`${this.key}\`
56
+
57
+ * Default: ${unindent(this.defaultDescription)}
58
+ * Type: ${unindent(this.typeDescription)}
59
+ ${deprecated}
60
+ ${description}
61
+ ${exclusive}
62
+ ${noEnvExport}`);
63
+ }
64
+ };
65
+ const describeUsage = (def) => {
66
+ let key = "";
67
+ if (!Array.isArray(def.type)) {
68
+ if (def.short) key = `-${def.short}|`;
69
+ if (def.type === Boolean && def.default !== false) key = `${key}--no-${def.key}`;
70
+ else key = `${key}--${def.key}`;
71
+ if (def.type !== Boolean) key = `${key} ${def.hint}`;
72
+ return key;
73
+ }
74
+ key = `--${def.key}`;
75
+ if (def.short) key = `-${def.short}|--${def.key}`;
76
+ let types = def.type;
77
+ const multiple = types.includes(Array);
78
+ const bool = types.includes(Boolean);
79
+ types = types.filter((t) => t !== null && t !== Array && t !== Boolean);
80
+ if (!types.length) return key;
81
+ let description;
82
+ if (!types.some((t) => typeof t !== "string")) description = `<${types.filter((d) => d).join("|")}>`;
83
+ else description = def.hint;
84
+ if (bool) key = `--no-${def.key}|${key}`;
85
+ const usage = `${key} ${description}`;
86
+ if (multiple) return `${usage} [${usage} ...]`;
87
+ else return usage;
88
+ };
89
+ const describeType = (type) => {
90
+ if (Array.isArray(type)) {
91
+ const descriptions = type.filter((t) => t !== Array).map((t) => describeType(t));
92
+ const last = descriptions.length > 1 ? [descriptions.pop()] : [];
93
+ const oxford = descriptions.length > 1 ? ", or " : " or ";
94
+ return `${[descriptions.join(", ")].concat(last).join(oxford)}${type.includes(Array) ? " (can be set multiple times)" : ""}`;
95
+ }
96
+ switch (type) {
97
+ case String: return "String";
98
+ case Number: return "Number";
99
+ case Umask: return "Octal numeric string in range 0000..0777 (0..511)";
100
+ case Boolean: return "Boolean";
101
+ case Date: return "Date";
102
+ case path: return "Path";
103
+ case semver: return "SemVer string";
104
+ case url: return "URL";
105
+ default: return describeValue(type);
106
+ }
107
+ };
108
+ const describeValue = (val) => typeof val === "string" ? JSON.stringify(val) : String(val);
109
+ const unindent = (s) => {
110
+ const match = s.match(/\n +/);
111
+ return !match ? s.trim() : s.split(match[0]).join("\n").trim();
112
+ };
113
+ const wrap = (s) => {
114
+ const cols = Math.min(Math.max(20, process.stdout.columns) || 80, 80) - 5;
115
+ return unindent(s).split(/[ \n]+/).reduce((left, right) => {
116
+ const last = left.split("\n").pop();
117
+ return left + (last.length && last.length + right.length > cols ? "\n" : " ") + right;
118
+ });
119
+ };
120
+ const wrapAll = (s) => {
121
+ let inCodeBlock = false;
122
+ return s.split("\n\n").map((block) => {
123
+ if (inCodeBlock || block.startsWith("```")) {
124
+ inCodeBlock = !block.endsWith("```");
125
+ return block;
126
+ }
127
+ if (block.charAt(0) === "*") return "* " + block.slice(1).trim().split("\n* ").map((li) => {
128
+ return wrap(li).replace(/\n/g, "\n ");
129
+ }).join("\n* ");
130
+ else return wrap(block);
131
+ }).join("\n\n");
132
+ };
133
+ module.exports = Definition;
134
+ }));
135
+ //#endregion
136
+ //#region ../../node_modules/.pnpm/@npmcli+config@11.0.1/node_modules/@npmcli/config/lib/parse-allow-scripts-list.js
137
+ var require_parse_allow_scripts_list = /* @__PURE__ */ __commonJSMin(((exports, module) => {
138
+ const parseAllowScriptsList = (raw) => {
139
+ const parts = [];
140
+ const entries = Array.isArray(raw) ? raw : typeof raw === "string" ? [raw] : [];
141
+ for (const entry of entries) {
142
+ if (typeof entry !== "string") continue;
143
+ for (const part of entry.split(",")) {
144
+ const trimmed = part.trim();
145
+ if (trimmed) parts.push(trimmed);
146
+ }
147
+ }
148
+ return parts;
149
+ };
150
+ module.exports = parseAllowScriptsList;
151
+ }));
152
+ //#endregion
153
+ //#region ../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json
154
+ var require_vendors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
155
+ module.exports = [
156
+ {
157
+ "name": "Agola CI",
158
+ "constant": "AGOLA",
159
+ "env": "AGOLA_GIT_REF",
160
+ "pr": "AGOLA_PULL_REQUEST_ID"
161
+ },
162
+ {
163
+ "name": "Alpic",
164
+ "constant": "ALPIC",
165
+ "env": "ALPIC_HOST"
166
+ },
167
+ {
168
+ "name": "Appcircle",
169
+ "constant": "APPCIRCLE",
170
+ "env": "AC_APPCIRCLE",
171
+ "pr": {
172
+ "env": "AC_GIT_PR",
173
+ "ne": "false"
174
+ }
175
+ },
176
+ {
177
+ "name": "AppVeyor",
178
+ "constant": "APPVEYOR",
179
+ "env": "APPVEYOR",
180
+ "pr": "APPVEYOR_PULL_REQUEST_NUMBER"
181
+ },
182
+ {
183
+ "name": "AWS CodeBuild",
184
+ "constant": "CODEBUILD",
185
+ "env": "CODEBUILD_BUILD_ARN",
186
+ "pr": {
187
+ "env": "CODEBUILD_WEBHOOK_EVENT",
188
+ "any": [
189
+ "PULL_REQUEST_CREATED",
190
+ "PULL_REQUEST_UPDATED",
191
+ "PULL_REQUEST_REOPENED"
192
+ ]
193
+ }
194
+ },
195
+ {
196
+ "name": "Azure Pipelines",
197
+ "constant": "AZURE_PIPELINES",
198
+ "env": "TF_BUILD",
199
+ "pr": { "BUILD_REASON": "PullRequest" }
200
+ },
201
+ {
202
+ "name": "Bamboo",
203
+ "constant": "BAMBOO",
204
+ "env": "bamboo_planKey"
205
+ },
206
+ {
207
+ "name": "Bitbucket Pipelines",
208
+ "constant": "BITBUCKET",
209
+ "env": "BITBUCKET_COMMIT",
210
+ "pr": "BITBUCKET_PR_ID"
211
+ },
212
+ {
213
+ "name": "Bitrise",
214
+ "constant": "BITRISE",
215
+ "env": "BITRISE_IO",
216
+ "pr": "BITRISE_PULL_REQUEST"
217
+ },
218
+ {
219
+ "name": "Buddy",
220
+ "constant": "BUDDY",
221
+ "env": "BUDDY_WORKSPACE_ID",
222
+ "pr": "BUDDY_EXECUTION_PULL_REQUEST_ID"
223
+ },
224
+ {
225
+ "name": "Buildkite",
226
+ "constant": "BUILDKITE",
227
+ "env": "BUILDKITE",
228
+ "pr": {
229
+ "env": "BUILDKITE_PULL_REQUEST",
230
+ "ne": "false"
231
+ }
232
+ },
233
+ {
234
+ "name": "CircleCI",
235
+ "constant": "CIRCLE",
236
+ "env": "CIRCLECI",
237
+ "pr": "CIRCLE_PULL_REQUEST"
238
+ },
239
+ {
240
+ "name": "Cirrus CI",
241
+ "constant": "CIRRUS",
242
+ "env": "CIRRUS_CI",
243
+ "pr": "CIRRUS_PR"
244
+ },
245
+ {
246
+ "name": "Cloudflare Pages",
247
+ "constant": "CLOUDFLARE_PAGES",
248
+ "env": "CF_PAGES"
249
+ },
250
+ {
251
+ "name": "Cloudflare Workers",
252
+ "constant": "CLOUDFLARE_WORKERS",
253
+ "env": "WORKERS_CI"
254
+ },
255
+ {
256
+ "name": "Codefresh",
257
+ "constant": "CODEFRESH",
258
+ "env": "CF_BUILD_ID",
259
+ "pr": { "any": ["CF_PULL_REQUEST_NUMBER", "CF_PULL_REQUEST_ID"] }
260
+ },
261
+ {
262
+ "name": "Codemagic",
263
+ "constant": "CODEMAGIC",
264
+ "env": "CM_BUILD_ID",
265
+ "pr": "CM_PULL_REQUEST"
266
+ },
267
+ {
268
+ "name": "Codeship",
269
+ "constant": "CODESHIP",
270
+ "env": { "CI_NAME": "codeship" }
271
+ },
272
+ {
273
+ "name": "Drone",
274
+ "constant": "DRONE",
275
+ "env": "DRONE",
276
+ "pr": { "DRONE_BUILD_EVENT": "pull_request" }
277
+ },
278
+ {
279
+ "name": "dsari",
280
+ "constant": "DSARI",
281
+ "env": "DSARI"
282
+ },
283
+ {
284
+ "name": "Earthly",
285
+ "constant": "EARTHLY",
286
+ "env": "EARTHLY_CI"
287
+ },
288
+ {
289
+ "name": "Expo Application Services",
290
+ "constant": "EAS",
291
+ "env": "EAS_BUILD"
292
+ },
293
+ {
294
+ "name": "Gerrit",
295
+ "constant": "GERRIT",
296
+ "env": "GERRIT_PROJECT"
297
+ },
298
+ {
299
+ "name": "Gitea Actions",
300
+ "constant": "GITEA_ACTIONS",
301
+ "env": "GITEA_ACTIONS"
302
+ },
303
+ {
304
+ "name": "GitHub Actions",
305
+ "constant": "GITHUB_ACTIONS",
306
+ "env": "GITHUB_ACTIONS",
307
+ "pr": { "GITHUB_EVENT_NAME": "pull_request" }
308
+ },
309
+ {
310
+ "name": "GitLab CI",
311
+ "constant": "GITLAB",
312
+ "env": "GITLAB_CI",
313
+ "pr": "CI_MERGE_REQUEST_ID"
314
+ },
315
+ {
316
+ "name": "GoCD",
317
+ "constant": "GOCD",
318
+ "env": "GO_PIPELINE_LABEL"
319
+ },
320
+ {
321
+ "name": "Google Cloud Build",
322
+ "constant": "GOOGLE_CLOUD_BUILD",
323
+ "env": "BUILDER_OUTPUT"
324
+ },
325
+ {
326
+ "name": "Harness CI",
327
+ "constant": "HARNESS",
328
+ "env": "HARNESS_BUILD_ID"
329
+ },
330
+ {
331
+ "name": "Heroku",
332
+ "constant": "HEROKU",
333
+ "env": {
334
+ "env": "NODE",
335
+ "includes": "/app/.heroku/node/bin/node"
336
+ }
337
+ },
338
+ {
339
+ "name": "Hudson",
340
+ "constant": "HUDSON",
341
+ "env": "HUDSON_URL"
342
+ },
343
+ {
344
+ "name": "Jenkins",
345
+ "constant": "JENKINS",
346
+ "env": ["JENKINS_URL", "BUILD_ID"],
347
+ "pr": { "any": ["ghprbPullId", "CHANGE_ID"] }
348
+ },
349
+ {
350
+ "name": "LayerCI",
351
+ "constant": "LAYERCI",
352
+ "env": "LAYERCI",
353
+ "pr": "LAYERCI_PULL_REQUEST"
354
+ },
355
+ {
356
+ "name": "Magnum CI",
357
+ "constant": "MAGNUM",
358
+ "env": "MAGNUM"
359
+ },
360
+ {
361
+ "name": "Netlify CI",
362
+ "constant": "NETLIFY",
363
+ "env": "NETLIFY",
364
+ "pr": {
365
+ "env": "PULL_REQUEST",
366
+ "ne": "false"
367
+ }
368
+ },
369
+ {
370
+ "name": "Nevercode",
371
+ "constant": "NEVERCODE",
372
+ "env": "NEVERCODE",
373
+ "pr": {
374
+ "env": "NEVERCODE_PULL_REQUEST",
375
+ "ne": "false"
376
+ }
377
+ },
378
+ {
379
+ "name": "Prow",
380
+ "constant": "PROW",
381
+ "env": "PROW_JOB_ID"
382
+ },
383
+ {
384
+ "name": "ReleaseHub",
385
+ "constant": "RELEASEHUB",
386
+ "env": "RELEASE_BUILD_ID"
387
+ },
388
+ {
389
+ "name": "Render",
390
+ "constant": "RENDER",
391
+ "env": "RENDER",
392
+ "pr": { "IS_PULL_REQUEST": "true" }
393
+ },
394
+ {
395
+ "name": "Sail CI",
396
+ "constant": "SAIL",
397
+ "env": "SAILCI",
398
+ "pr": "SAIL_PULL_REQUEST_NUMBER"
399
+ },
400
+ {
401
+ "name": "Screwdriver",
402
+ "constant": "SCREWDRIVER",
403
+ "env": "SCREWDRIVER",
404
+ "pr": {
405
+ "env": "SD_PULL_REQUEST",
406
+ "ne": "false"
407
+ }
408
+ },
409
+ {
410
+ "name": "Semaphore",
411
+ "constant": "SEMAPHORE",
412
+ "env": "SEMAPHORE",
413
+ "pr": "PULL_REQUEST_NUMBER"
414
+ },
415
+ {
416
+ "name": "Sourcehut",
417
+ "constant": "SOURCEHUT",
418
+ "env": { "CI_NAME": "sourcehut" }
419
+ },
420
+ {
421
+ "name": "Strider CD",
422
+ "constant": "STRIDER",
423
+ "env": "STRIDER"
424
+ },
425
+ {
426
+ "name": "TaskCluster",
427
+ "constant": "TASKCLUSTER",
428
+ "env": ["TASK_ID", "RUN_ID"]
429
+ },
430
+ {
431
+ "name": "TeamCity",
432
+ "constant": "TEAMCITY",
433
+ "env": "TEAMCITY_VERSION"
434
+ },
435
+ {
436
+ "name": "Travis CI",
437
+ "constant": "TRAVIS",
438
+ "env": "TRAVIS",
439
+ "pr": {
440
+ "env": "TRAVIS_PULL_REQUEST",
441
+ "ne": "false"
442
+ }
443
+ },
444
+ {
445
+ "name": "Vela",
446
+ "constant": "VELA",
447
+ "env": "VELA",
448
+ "pr": { "VELA_PULL_REQUEST": "1" }
449
+ },
450
+ {
451
+ "name": "Vercel",
452
+ "constant": "VERCEL",
453
+ "env": { "any": ["NOW_BUILDER", "VERCEL"] },
454
+ "pr": "VERCEL_GIT_PULL_REQUEST_ID"
455
+ },
456
+ {
457
+ "name": "Visual Studio App Center",
458
+ "constant": "APPCENTER",
459
+ "env": "APPCENTER_BUILD_ID"
460
+ },
461
+ {
462
+ "name": "Woodpecker",
463
+ "constant": "WOODPECKER",
464
+ "env": { "CI": "woodpecker" },
465
+ "pr": { "CI_BUILD_EVENT": "pull_request" }
466
+ },
467
+ {
468
+ "name": "Xcode Cloud",
469
+ "constant": "XCODE_CLOUD",
470
+ "env": "CI_XCODE_PROJECT",
471
+ "pr": "CI_PULL_REQUEST_NUMBER"
472
+ },
473
+ {
474
+ "name": "Xcode Server",
475
+ "constant": "XCODE_SERVER",
476
+ "env": "XCS"
477
+ }
478
+ ];
479
+ }));
480
+ //#endregion
481
+ //#region ../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/index.js
482
+ var require_ci_info = /* @__PURE__ */ __commonJSMin(((exports) => {
483
+ const vendors = require_vendors();
484
+ const env = process.env;
485
+ Object.defineProperty(exports, "_vendors", { value: vendors.map(function(v) {
486
+ return v.constant;
487
+ }) });
488
+ exports.name = null;
489
+ exports.isPR = null;
490
+ exports.id = null;
491
+ if (env.CI !== "false") vendors.forEach(function(vendor) {
492
+ const isCI = (Array.isArray(vendor.env) ? vendor.env : [vendor.env]).every(function(obj) {
493
+ return checkEnv(obj);
494
+ });
495
+ exports[vendor.constant] = isCI;
496
+ if (!isCI) return;
497
+ exports.name = vendor.name;
498
+ exports.isPR = checkPR(vendor);
499
+ exports.id = vendor.constant;
500
+ });
501
+ exports.isCI = !!(env.CI !== "false" && (env.BUILD_ID || env.BUILD_NUMBER || env.CI || env.CI_APP_ID || env.CI_BUILD_ID || env.CI_BUILD_NUMBER || env.CI_NAME || env.CONTINUOUS_INTEGRATION || env.RUN_ID || exports.name || false));
502
+ function checkEnv(obj) {
503
+ if (typeof obj === "string") return !!env[obj];
504
+ if ("env" in obj) return env[obj.env] && env[obj.env].includes(obj.includes);
505
+ if ("any" in obj) return obj.any.some(function(k) {
506
+ return !!env[k];
507
+ });
508
+ return Object.keys(obj).every(function(k) {
509
+ return env[k] === obj[k];
510
+ });
511
+ }
512
+ function checkPR(vendor) {
513
+ switch (typeof vendor.pr) {
514
+ case "string": return !!env[vendor.pr];
515
+ case "object": if ("env" in vendor.pr) {
516
+ if ("any" in vendor.pr) return vendor.pr.any.some(function(key) {
517
+ return env[vendor.pr.env] === key;
518
+ });
519
+ else return vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne;
520
+ } else if ("any" in vendor.pr) return vendor.pr.any.some(function(key) {
521
+ return !!env[key];
522
+ });
523
+ else return checkEnv(vendor.pr);
524
+ default: return null;
525
+ }
526
+ }
527
+ }));
528
+ //#endregion
529
+ //#region ../../node_modules/.pnpm/@npmcli+config@11.0.1/node_modules/@npmcli/config/lib/definitions/definitions.js
530
+ var require_definitions$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
531
+ const Definition = require_definition();
532
+ const parseAllowScriptsList = require_parse_allow_scripts_list();
533
+ const ciInfo = require_ci_info();
534
+ const querystring = __require("node:querystring");
535
+ const { join } = __require("node:path");
536
+ const isWindows = process.platform === "win32";
537
+ const { readFileSync } = __require("node:fs");
538
+ const maybeReadFile = (file) => {
539
+ try {
540
+ return readFileSync(file, "utf8");
541
+ } catch (er) {
542
+ if (er.code !== "ENOENT") throw er;
543
+ return null;
544
+ }
545
+ };
546
+ const buildOmitList = (obj) => {
547
+ const include = obj.include || [];
548
+ const omit = obj.omit || [];
549
+ const only = obj.only;
550
+ if (/^prod(uction)?$/.test(only) || obj.production) omit.push("dev");
551
+ else if (obj.production === false) include.push("dev");
552
+ if (/^dev/.test(obj.also)) include.push("dev");
553
+ if (obj.dev) include.push("dev");
554
+ if (obj.optional === false) omit.push("optional");
555
+ else if (obj.optional === true) include.push("optional");
556
+ obj.omit = [...new Set(omit)].filter((type) => !include.includes(type));
557
+ obj.include = [...new Set(include)];
558
+ if (obj.omit.includes("dev")) process.env.NODE_ENV = "production";
559
+ return obj.omit;
560
+ };
561
+ const editor = process.env.EDITOR || process.env.VISUAL || (isWindows ? `${process.env.SYSTEMROOT}\\notepad.exe` : "vi");
562
+ const shell = isWindows ? process.env.ComSpec || "cmd" : process.env.SHELL || "sh";
563
+ const { networkInterfaces } = __require("node:os");
564
+ const getLocalAddresses = () => {
565
+ try {
566
+ return Object.values(networkInterfaces()).map((int) => int.map(({ address }) => address)).reduce((set, addrs) => set.concat(addrs), [null]);
567
+ } catch (e) {
568
+ return [null];
569
+ }
570
+ };
571
+ const unicode = /UTF-?8$/i.test(process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG);
572
+ const cache = `${isWindows && process.env.LOCALAPPDATA || "~"}/${isWindows ? "npm-cache" : ".npm"}`;
573
+ const { semver: { type: Semver }, Umask: { type: Umask }, url: { type: url }, path: { type: path } } = require_type_defs();
574
+ const flatten = (key, obj, flatOptions) => {
575
+ const camel = key.replace(/-([a-z])/g, (_0, _1) => _1.toUpperCase());
576
+ flatOptions[camel] = obj[key];
577
+ };
578
+ const definitions = {
579
+ _auth: new Definition("_auth", {
580
+ default: null,
581
+ type: [null, String],
582
+ description: `
583
+ A basic-auth string to use when authenticating against the npm registry.
584
+ This will ONLY be used to authenticate against the npm registry. For other
585
+ registries you will need to scope it like "//other-registry.tld/:_auth"
586
+
587
+ Warning: This should generally not be set via a command-line option. It
588
+ is safer to use a registry-provided authentication bearer token stored in
589
+ the ~/.npmrc file by running \`npm login\`.
590
+ `,
591
+ flatten
592
+ }),
593
+ access: new Definition("access", {
594
+ default: null,
595
+ defaultDescription: `
596
+ 'public' for new packages, existing packages it will not change the current level
597
+ `,
598
+ type: [
599
+ null,
600
+ "restricted",
601
+ "public",
602
+ "private"
603
+ ],
604
+ description: `
605
+ If you do not want your scoped package to be publicly viewable (and
606
+ installable) set \`--access=restricted\`.
607
+
608
+ Unscoped packages cannot be set to \`restricted\`.
609
+
610
+ Note: This defaults to not changing the current access level for existing
611
+ packages. Specifying a value of \`restricted\` or \`public\` during
612
+ publish will change the access for an existing package the same way that
613
+ \`npm access set status\` would.
614
+
615
+ The value \`private\` is an alias for \`restricted\`.
616
+ `,
617
+ flatten(key, obj, flatOptions) {
618
+ const value = obj[key];
619
+ flatOptions.access = value === "private" ? "restricted" : value;
620
+ }
621
+ }),
622
+ all: new Definition("all", {
623
+ default: false,
624
+ type: Boolean,
625
+ short: "a",
626
+ description: `
627
+ Show or act on all packages, not just the ones your project directly
628
+ depends on. For \`npm outdated\` and \`npm ls\` this lists every outdated
629
+ or installed package. For \`npm approve-scripts\` and \`npm deny-scripts\`
630
+ it selects every package with pending install scripts.
631
+ `,
632
+ flatten
633
+ }),
634
+ "allow-same-version": new Definition("allow-same-version", {
635
+ default: false,
636
+ type: Boolean,
637
+ description: `
638
+ Prevents throwing an error when \`npm version\` is used to set the new
639
+ version to the same value as the current version.
640
+ `,
641
+ flatten
642
+ }),
643
+ "allow-directory": new Definition("allow-directory", {
644
+ default: "all",
645
+ type: [
646
+ "all",
647
+ "none",
648
+ "root"
649
+ ],
650
+ description: `
651
+ Limits the ability for npm to install dependencies from directories.
652
+ That is, dependencies that point to a directory instead of a version or semver range.
653
+ Please note that this could leave your tree incomplete and some packages may not function as intended or designed.
654
+ Changing this setting will not remove dependencies that are already installed.
655
+
656
+ \`all\` allows any directories to be installed.
657
+ \`none\` prevents any directories from being installed.
658
+ \`root\` only allows directories defined in your project's package.json to be installed. Also allows directory dependencies to be used for other commands like \`npm view\`
659
+ `,
660
+ flatten
661
+ }),
662
+ "allow-file": new Definition("allow-file", {
663
+ default: "all",
664
+ type: [
665
+ "all",
666
+ "none",
667
+ "root"
668
+ ],
669
+ description: `
670
+ Limits the ability for npm to install dependencies from tarball files.
671
+ That is, dependencies that point to a local tarball file instead of a version or semver range.
672
+ Please note that this could leave your tree incomplete and some packages may not function as intended or designed.
673
+ Changing this setting will not remove dependencies that are already installed.
674
+
675
+ \`all\` allows any tarball file to be installed.
676
+ \`none\` prevents any tarball file from being installed.
677
+ \`root\` only allows tarball files defined in your project's package.json to be installed. Also allows tarball file dependencies to be used for other commands like \`npm view\`
678
+ `,
679
+ flatten
680
+ }),
681
+ "allow-git": new Definition("allow-git", {
682
+ default: "none",
683
+ type: [
684
+ "all",
685
+ "none",
686
+ "root"
687
+ ],
688
+ description: `
689
+ Limits the ability for npm to fetch dependencies from git references.
690
+ That is, dependencies that point to a git repo instead of a version or semver range.
691
+ Please note that this could leave your tree incomplete and some packages may not function as intended or designed.
692
+ Changing this setting will not remove dependencies that are already installed.
693
+
694
+ As of npm 12 the default is \`none\`. Git dependencies run \`git\`
695
+ against a remote repo and may install configuration the project does
696
+ not control. Opt in explicitly per project (in \`.npmrc\`) or per
697
+ command (on the CLI) when you need git deps.
698
+
699
+ \`all\` allows any git dependencies to be fetched and installed.
700
+ \`none\` prevents any git dependencies from being fetched and installed.
701
+ \`root\` only allows git dependencies defined in your project's package.json to be fetched and installed. Also allows git dependencies to be fetched for other commands like \`npm view\`
702
+ `,
703
+ flatten
704
+ }),
705
+ "allow-remote": new Definition("allow-remote", {
706
+ default: "none",
707
+ type: [
708
+ "all",
709
+ "none",
710
+ "root"
711
+ ],
712
+ description: `
713
+ Limits the ability for npm to fetch dependencies from urls.
714
+ That is, dependencies that point to a tarball url instead of a version or semver range.
715
+ Please note that this could leave your tree incomplete and some packages may not function as intended or designed.
716
+ Changing this setting will not remove dependencies that are already installed.
717
+
718
+ As of npm 12 the default is \`none\`. Tarballs that share a hostname
719
+ with the configured registry (the typical case for the npm registry,
720
+ GitHub Packages, and most private registries) are still installed
721
+ normally. If your registry serves tarballs from a different host,
722
+ set \`replace-registry-host\` or override this setting. Opt in
723
+ explicitly per project (in \`.npmrc\`) or per command (on the CLI)
724
+ when you intentionally install from a URL.
725
+
726
+ \`all\` allows any url to be installed.
727
+ \`none\` prevents any url from being installed.
728
+ \`root\` only allows urls defined in your project's package.json to be installed. Also allows url dependencies to be used for other commands like \`npm view\`
729
+ `,
730
+ flatten
731
+ }),
732
+ "allow-scripts": new Definition("allow-scripts", {
733
+ default: "",
734
+ type: [String, Array],
735
+ hint: "<package-list>",
736
+ description: `
737
+ Comma-separated list of packages whose install-time lifecycle scripts
738
+ (\`preinstall\`, \`install\`, \`postinstall\`, and \`prepare\` for
739
+ non-registry dependencies) are allowed to run.
740
+
741
+ This setting is intended for one-off and global contexts: \`npm exec\`,
742
+ \`npx\`, and \`npm install -g\`, where no project \`package.json\` is
743
+ involved. For team-wide policy in a project, use the \`allowScripts\`
744
+ field in \`package.json\` (which also supports explicit denials), or
745
+ configure it in \`.npmrc\`. Passing \`--allow-scripts\` on the command
746
+ line during a project-scoped \`npm install\`, \`ci\`, \`update\`, or
747
+ \`rebuild\` is an error.
748
+
749
+ Each name is matched against a dependency's resolved identity, not
750
+ against the package's self-reported name. \`--ignore-scripts\` and
751
+ \`--dangerously-allow-all-scripts\` both override this setting.
752
+ `,
753
+ flatten(key, obj, flatOptions) {
754
+ flatOptions.allowScripts = parseAllowScriptsList(obj[key]);
755
+ }
756
+ }),
757
+ also: new Definition("also", {
758
+ default: null,
759
+ type: [
760
+ null,
761
+ "dev",
762
+ "development"
763
+ ],
764
+ description: `
765
+ When set to \`dev\` or \`development\`, this is an alias for
766
+ \`--include=dev\`.
767
+ `,
768
+ deprecated: "Please use --include=dev instead.",
769
+ flatten(key, obj, flatOptions) {
770
+ definitions.omit.flatten("omit", obj, flatOptions);
771
+ }
772
+ }),
773
+ audit: new Definition("audit", {
774
+ default: true,
775
+ type: Boolean,
776
+ description: `
777
+ When "true" submit audit reports alongside the current npm command to the
778
+ default registry and all registries configured for scopes. See the
779
+ documentation for [\`npm audit\`](/commands/npm-audit) for details on what
780
+ is submitted.
781
+ `,
782
+ flatten
783
+ }),
784
+ "audit-level": new Definition("audit-level", {
785
+ default: null,
786
+ type: [
787
+ null,
788
+ "info",
789
+ "low",
790
+ "moderate",
791
+ "high",
792
+ "critical",
793
+ "none"
794
+ ],
795
+ description: `
796
+ The minimum level of vulnerability for \`npm audit\` to exit with
797
+ a non-zero exit code.
798
+ `,
799
+ flatten
800
+ }),
801
+ "auth-type": new Definition("auth-type", {
802
+ default: "web",
803
+ type: ["legacy", "web"],
804
+ description: `
805
+ What authentication strategy to use with \`login\`.
806
+ Note that if an \`otp\` config is given, this value will always be set to \`legacy\`.
807
+ `,
808
+ flatten
809
+ }),
810
+ before: new Definition("before", {
811
+ default: null,
812
+ hint: "<date>",
813
+ type: [null, Date],
814
+ description: `
815
+ If passed to \`npm install\`, will rebuild the npm tree such that only
816
+ versions that were available **on or before** the given date are
817
+ installed. If there are no versions available for the current set of
818
+ dependencies, the command will error.
819
+
820
+ If the requested version is a \`dist-tag\` and the given tag does not
821
+ pass the \`--before\` filter, the most recent version less than or equal
822
+ to that tag will be used. For example, \`foo@latest\` might install
823
+ \`foo@1.2\` even though \`latest\` is \`2.0\`.
824
+
825
+ If \`before\` and \`min-release-age\` are both set in the same source,
826
+ \`before\` wins (an explicit absolute date overrides a relative window).
827
+ Across sources, the standard precedence applies (cli > env > project >
828
+ user > global), so a higher-priority source can always relax or
829
+ override a lower-priority one.
830
+
831
+ As with \`min-release-age\`, when this cutoff blocks a fix that
832
+ \`npm audit fix\` would install, npm keeps the vulnerable version, warns,
833
+ and exits with a non-zero code.
834
+
835
+ Packages whose names match \`min-release-age-exclude\` are exempt from
836
+ this filter.
837
+ `,
838
+ flatten
839
+ }),
840
+ "bin-links": new Definition("bin-links", {
841
+ default: true,
842
+ type: Boolean,
843
+ description: `
844
+ Tells npm to create symlinks (or \`.cmd\` shims on Windows) for package
845
+ executables.
846
+
847
+ Set to false to have it not do this. This can be used to work around the
848
+ fact that some file systems don't support symlinks, even on ostensibly
849
+ Unix systems.
850
+ `,
851
+ flatten
852
+ }),
853
+ browser: new Definition("browser", {
854
+ default: null,
855
+ defaultDescription: `
856
+ macOS: \`"open"\`, Windows: \`"start"\`, Others: \`"xdg-open"\`
857
+ `,
858
+ type: [
859
+ null,
860
+ Boolean,
861
+ String
862
+ ],
863
+ description: `
864
+ The browser that is called by npm commands to open websites.
865
+
866
+ Set to \`false\` to suppress browser behavior and instead print urls to
867
+ terminal.
868
+
869
+ Set to \`true\` to use default system URL opener.
870
+ `,
871
+ flatten
872
+ }),
873
+ "bypass-2fa": new Definition("bypass-2fa", {
874
+ default: false,
875
+ type: Boolean,
876
+ description: `
877
+ When creating a Granular Access Token with \`npm token create\`,
878
+ setting this to true will allow the token to bypass two-factor
879
+ authentication. This is useful for automation and CI/CD workflows.
880
+ `,
881
+ flatten
882
+ }),
883
+ ca: new Definition("ca", {
884
+ default: null,
885
+ type: [
886
+ null,
887
+ String,
888
+ Array
889
+ ],
890
+ description: `
891
+ The Certificate Authority signing certificate that is trusted for SSL
892
+ connections to the registry. Values should be in PEM format (Windows
893
+ calls it "Base-64 encoded X.509 (.CER)") with newlines replaced by the
894
+ string "\\n". For example:
895
+
896
+ \`\`\`ini
897
+ ca="-----BEGIN CERTIFICATE-----\\nXXXX\\nXXXX\\n-----END CERTIFICATE-----"
898
+ \`\`\`
899
+
900
+ Set to \`null\` to only allow "known" registrars, or to a specific CA
901
+ cert to trust only that specific signing authority.
902
+
903
+ Multiple CAs can be trusted by specifying an array of certificates:
904
+
905
+ \`\`\`ini
906
+ ca[]="..."
907
+ ca[]="..."
908
+ \`\`\`
909
+
910
+ See also the \`strict-ssl\` config.
911
+ `,
912
+ flatten
913
+ }),
914
+ cache: new Definition("cache", {
915
+ default: cache,
916
+ defaultDescription: `
917
+ Windows: \`%LocalAppData%\\npm-cache\`, Posix: \`~/.npm\`
918
+ `,
919
+ type: path,
920
+ description: `
921
+ The location of npm's cache directory.
922
+ `,
923
+ flatten(key, obj, flatOptions) {
924
+ flatOptions.cache = join(obj.cache, "_cacache");
925
+ flatOptions.npxCache = join(obj.cache, "_npx");
926
+ flatOptions.tufCache = join(obj.cache, "_tuf");
927
+ }
928
+ }),
929
+ "cache-max": new Definition("cache-max", {
930
+ default: Infinity,
931
+ type: Number,
932
+ description: `
933
+ \`--cache-max=0\` is an alias for \`--prefer-online\`
934
+ `,
935
+ deprecated: `
936
+ This option has been deprecated in favor of \`--prefer-online\`
937
+ `,
938
+ flatten(key, obj, flatOptions) {
939
+ if (obj[key] <= 0) flatOptions.preferOnline = true;
940
+ }
941
+ }),
942
+ "cache-min": new Definition("cache-min", {
943
+ default: 0,
944
+ type: Number,
945
+ description: `
946
+ \`--cache-min=9999 (or bigger)\` is an alias for \`--prefer-offline\`.
947
+ `,
948
+ deprecated: `
949
+ This option has been deprecated in favor of \`--prefer-offline\`.
950
+ `,
951
+ flatten(key, obj, flatOptions) {
952
+ if (obj[key] >= 9999) flatOptions.preferOffline = true;
953
+ }
954
+ }),
955
+ cafile: new Definition("cafile", {
956
+ default: null,
957
+ type: path,
958
+ description: `
959
+ A path to a file containing one or multiple Certificate Authority signing
960
+ certificates. Similar to the \`ca\` setting, but allows for multiple
961
+ CA's, as well as for the CA information to be stored in a file on disk.
962
+ `,
963
+ flatten(key, obj, flatOptions) {
964
+ if (!obj.cafile) return;
965
+ const raw = maybeReadFile(obj.cafile);
966
+ if (!raw) return;
967
+ const delim = "-----END CERTIFICATE-----";
968
+ flatOptions.ca = raw.replace(/\r\n/g, "\n").split(delim).filter((section) => section.trim()).map((section) => section.trimLeft() + delim);
969
+ }
970
+ }),
971
+ call: new Definition("call", {
972
+ default: "",
973
+ type: String,
974
+ short: "c",
975
+ description: `
976
+ Optional companion option for \`npm exec\`, \`npx\` that allows for
977
+ specifying a custom command to be run along with the installed packages.
978
+
979
+ \`\`\`bash
980
+ npm exec --package yo --package generator-node --call "yo node"
981
+ \`\`\`
982
+ `,
983
+ flatten
984
+ }),
985
+ cert: new Definition("cert", {
986
+ default: null,
987
+ type: [null, String],
988
+ description: `
989
+ A client certificate to pass when accessing the registry. Values should
990
+ be in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with
991
+ newlines replaced by the string "\\n". For example:
992
+
993
+ \`\`\`ini
994
+ cert="-----BEGIN CERTIFICATE-----\\nXXXX\\nXXXX\\n-----END CERTIFICATE-----"
995
+ \`\`\`
996
+
997
+ It is _not_ the path to a certificate file, though you can set a registry-scoped
998
+ "certfile" path like "//other-registry.tld/:certfile=/path/to/cert.pem".
999
+ `,
1000
+ deprecated: `
1001
+ \`key\` and \`cert\` are no longer used for most registry operations.
1002
+ Use registry scoped \`keyfile\` and \`certfile\` instead.
1003
+ Example:
1004
+ //other-registry.tld/:keyfile=/path/to/key.pem
1005
+ //other-registry.tld/:certfile=/path/to/cert.crt
1006
+ `,
1007
+ flatten
1008
+ }),
1009
+ cidr: new Definition("cidr", {
1010
+ default: null,
1011
+ type: [
1012
+ null,
1013
+ String,
1014
+ Array
1015
+ ],
1016
+ description: `
1017
+ This is a list of CIDR address to be used when configuring limited access
1018
+ tokens with the \`npm token create\` command.
1019
+ `,
1020
+ flatten
1021
+ }),
1022
+ color: new Definition("color", {
1023
+ default: !process.env.NO_COLOR || process.env.NO_COLOR === "0",
1024
+ usage: "--color|--no-color|--color always",
1025
+ defaultDescription: `
1026
+ true unless the NO_COLOR environ is set to something other than '0'
1027
+ `,
1028
+ type: ["always", Boolean],
1029
+ description: `
1030
+ If false, never shows colors. If \`"always"\` then always shows colors.
1031
+ If true, then only prints color codes for tty file descriptors.
1032
+ `,
1033
+ flatten(key, obj, flatOptions) {
1034
+ flatOptions.color = !obj.color ? false : obj.color === "always" ? true : !!process.stdout.isTTY;
1035
+ flatOptions.logColor = !obj.color ? false : obj.color === "always" ? true : !!process.stderr.isTTY;
1036
+ }
1037
+ }),
1038
+ "commit-hooks": new Definition("commit-hooks", {
1039
+ default: true,
1040
+ type: Boolean,
1041
+ description: `
1042
+ Run git commit hooks when using the \`npm version\` command.
1043
+ `,
1044
+ flatten
1045
+ }),
1046
+ cpu: new Definition("cpu", {
1047
+ default: null,
1048
+ type: [null, String],
1049
+ description: `
1050
+ Override CPU architecture of native modules to install.
1051
+ Acceptable values are same as \`cpu\` field of package.json,
1052
+ which comes from \`process.arch\`.
1053
+ `,
1054
+ flatten
1055
+ }),
1056
+ "dangerously-allow-all-scripts": new Definition("dangerously-allow-all-scripts", {
1057
+ default: false,
1058
+ type: Boolean,
1059
+ description: `
1060
+ If \`true\`, bypass the \`allowScripts\` policy entirely and run every
1061
+ dependency install script regardless of whether it was approved or
1062
+ denied. Intended as a migration escape hatch only; its use is strongly
1063
+ discouraged. \`--ignore-scripts\` still takes precedence over this
1064
+ setting.
1065
+ `,
1066
+ flatten
1067
+ }),
1068
+ depth: new Definition("depth", {
1069
+ default: null,
1070
+ defaultDescription: `
1071
+ \`Infinity\` if \`--all\` is set; otherwise, \`0\`
1072
+ `,
1073
+ type: [null, Number],
1074
+ description: `
1075
+ The depth to go when recursing packages for \`npm ls\`.
1076
+
1077
+ If not set, \`npm ls\` will show only the immediate dependencies of the
1078
+ root project. If \`--all\` is set, then npm will show all dependencies
1079
+ by default.
1080
+ `,
1081
+ flatten
1082
+ }),
1083
+ description: new Definition("description", {
1084
+ default: true,
1085
+ type: Boolean,
1086
+ usage: "--no-description",
1087
+ description: `
1088
+ Show the description in \`npm search\`
1089
+ `,
1090
+ flatten(key, obj, flatOptions) {
1091
+ flatOptions.search = flatOptions.search || { limit: 20 };
1092
+ flatOptions.search[key] = obj[key];
1093
+ }
1094
+ }),
1095
+ dev: new Definition("dev", {
1096
+ default: false,
1097
+ type: Boolean,
1098
+ description: `
1099
+ Alias for \`--include=dev\`.
1100
+ `,
1101
+ deprecated: "Please use --include=dev instead.",
1102
+ flatten(key, obj, flatOptions) {
1103
+ definitions.omit.flatten("omit", obj, flatOptions);
1104
+ }
1105
+ }),
1106
+ diff: new Definition("diff", {
1107
+ default: [],
1108
+ hint: "<package-spec>",
1109
+ type: [String, Array],
1110
+ description: `
1111
+ Define arguments to compare in \`npm diff\`.
1112
+ `,
1113
+ flatten
1114
+ }),
1115
+ "diff-ignore-all-space": new Definition("diff-ignore-all-space", {
1116
+ default: false,
1117
+ type: Boolean,
1118
+ description: `
1119
+ Ignore whitespace when comparing lines in \`npm diff\`.
1120
+ `,
1121
+ flatten
1122
+ }),
1123
+ "diff-name-only": new Definition("diff-name-only", {
1124
+ default: false,
1125
+ type: Boolean,
1126
+ description: `
1127
+ Prints only filenames when using \`npm diff\`.
1128
+ `,
1129
+ flatten
1130
+ }),
1131
+ "diff-no-prefix": new Definition("diff-no-prefix", {
1132
+ default: false,
1133
+ type: Boolean,
1134
+ description: `
1135
+ Do not show any source or destination prefix in \`npm diff\` output.
1136
+
1137
+ Note: this causes \`npm diff\` to ignore the \`--diff-src-prefix\` and
1138
+ \`--diff-dst-prefix\` configs.
1139
+ `,
1140
+ flatten
1141
+ }),
1142
+ "diff-dst-prefix": new Definition("diff-dst-prefix", {
1143
+ default: "b/",
1144
+ hint: "<path>",
1145
+ type: String,
1146
+ description: `
1147
+ Destination prefix to be used in \`npm diff\` output.
1148
+ `,
1149
+ flatten
1150
+ }),
1151
+ "diff-src-prefix": new Definition("diff-src-prefix", {
1152
+ default: "a/",
1153
+ hint: "<path>",
1154
+ type: String,
1155
+ description: `
1156
+ Source prefix to be used in \`npm diff\` output.
1157
+ `,
1158
+ flatten
1159
+ }),
1160
+ "diff-text": new Definition("diff-text", {
1161
+ default: false,
1162
+ type: Boolean,
1163
+ description: `
1164
+ Treat all files as text in \`npm diff\`.
1165
+ `,
1166
+ flatten
1167
+ }),
1168
+ "diff-unified": new Definition("diff-unified", {
1169
+ default: 3,
1170
+ type: Number,
1171
+ description: `
1172
+ The number of lines of context to print in \`npm diff\`.
1173
+ `,
1174
+ flatten
1175
+ }),
1176
+ "dry-run": new Definition("dry-run", {
1177
+ default: false,
1178
+ type: Boolean,
1179
+ description: `
1180
+ Indicates that you don't want npm to make any changes and that it should
1181
+ only report what it would have done. This can be passed into any of the
1182
+ commands that modify your local installation, eg, \`install\`,
1183
+ \`update\`, \`dedupe\`, \`uninstall\`, as well as \`pack\` and
1184
+ \`publish\`.
1185
+
1186
+ Note: This is NOT honored by other network related commands, eg
1187
+ \`dist-tags\`, \`owner\`, etc.
1188
+ `,
1189
+ flatten
1190
+ }),
1191
+ editor: new Definition("editor", {
1192
+ default: editor,
1193
+ defaultDescription: `
1194
+ The EDITOR or VISUAL environment variables, or '%SYSTEMROOT%\\notepad.exe' on Windows,
1195
+ or 'vi' on Unix systems
1196
+ `,
1197
+ type: String,
1198
+ description: `
1199
+ The command to run for \`npm edit\` and \`npm config edit\`.
1200
+ `,
1201
+ flatten
1202
+ }),
1203
+ "engine-strict": new Definition("engine-strict", {
1204
+ default: false,
1205
+ type: Boolean,
1206
+ description: `
1207
+ If set to true, then npm will stubbornly refuse to install (or even
1208
+ consider installing) any package that claims to not be compatible with
1209
+ the current Node.js version.
1210
+
1211
+ This can be overridden by setting the \`--force\` flag.
1212
+ `,
1213
+ flatten
1214
+ }),
1215
+ "expect-result-count": new Definition("expect-result-count", {
1216
+ default: null,
1217
+ type: [null, Number],
1218
+ hint: "<count>",
1219
+ exclusive: ["expect-results"],
1220
+ description: `
1221
+ Tells to expect a specific number of results from the command.
1222
+ `
1223
+ }),
1224
+ "expect-results": new Definition("expect-results", {
1225
+ default: null,
1226
+ type: [null, Boolean],
1227
+ exclusive: ["expect-result-count"],
1228
+ description: `
1229
+ Tells npm whether or not to expect results from the command.
1230
+ Can be either true (expect some results) or false (expect no results).
1231
+ `
1232
+ }),
1233
+ expires: new Definition("expires", {
1234
+ default: null,
1235
+ type: [null, Number],
1236
+ description: `
1237
+ When creating a Granular Access Token with \`npm token create\`,
1238
+ this sets the expiration in days. If not specified, the server
1239
+ will determine the default expiration.
1240
+ `,
1241
+ flatten
1242
+ }),
1243
+ "extension-file": new Definition("extension-file", {
1244
+ default: null,
1245
+ type: [null, path],
1246
+ description: `
1247
+ Path to a project-local npm extension file to load instead of
1248
+ discovering \`.npm-extension.mjs\` / \`.npm-extension.cjs\` at the
1249
+ project root. Must resolve inside the project root and use a \`.mjs\`
1250
+ or \`.cjs\` extension. Only honored from project config or the command
1251
+ line, never from user, global, or builtin config.
1252
+ `,
1253
+ flatten
1254
+ }),
1255
+ "fetch-retries": new Definition("fetch-retries", {
1256
+ default: 2,
1257
+ type: Number,
1258
+ description: `
1259
+ The "retries" config for the \`retry\` module to use when fetching
1260
+ packages from the registry.
1261
+
1262
+ npm will retry idempotent read requests to the registry in the case
1263
+ of network failures or 5xx HTTP errors.
1264
+ `,
1265
+ flatten(key, obj, flatOptions) {
1266
+ flatOptions.retry = flatOptions.retry || {};
1267
+ flatOptions.retry.retries = obj[key];
1268
+ }
1269
+ }),
1270
+ "fetch-retry-factor": new Definition("fetch-retry-factor", {
1271
+ default: 10,
1272
+ type: Number,
1273
+ description: `
1274
+ The "factor" config for the \`retry\` module to use when fetching
1275
+ packages.
1276
+ `,
1277
+ flatten(key, obj, flatOptions) {
1278
+ flatOptions.retry = flatOptions.retry || {};
1279
+ flatOptions.retry.factor = obj[key];
1280
+ }
1281
+ }),
1282
+ "fetch-retry-maxtimeout": new Definition("fetch-retry-maxtimeout", {
1283
+ default: 6e4,
1284
+ defaultDescription: "60000 (1 minute)",
1285
+ type: Number,
1286
+ description: `
1287
+ The "maxTimeout" config for the \`retry\` module to use when fetching
1288
+ packages.
1289
+ `,
1290
+ flatten(key, obj, flatOptions) {
1291
+ flatOptions.retry = flatOptions.retry || {};
1292
+ flatOptions.retry.maxTimeout = obj[key];
1293
+ }
1294
+ }),
1295
+ "fetch-retry-mintimeout": new Definition("fetch-retry-mintimeout", {
1296
+ default: 1e4,
1297
+ defaultDescription: "10000 (10 seconds)",
1298
+ type: Number,
1299
+ description: `
1300
+ The "minTimeout" config for the \`retry\` module to use when fetching
1301
+ packages.
1302
+ `,
1303
+ flatten(key, obj, flatOptions) {
1304
+ flatOptions.retry = flatOptions.retry || {};
1305
+ flatOptions.retry.minTimeout = obj[key];
1306
+ }
1307
+ }),
1308
+ "fetch-timeout": new Definition("fetch-timeout", {
1309
+ default: 3e5,
1310
+ defaultDescription: `300000 (5 minutes)`,
1311
+ type: Number,
1312
+ description: `
1313
+ The maximum amount of time to wait for HTTP requests to complete.
1314
+ `,
1315
+ flatten(key, obj, flatOptions) {
1316
+ flatOptions.timeout = obj[key];
1317
+ }
1318
+ }),
1319
+ force: new Definition("force", {
1320
+ default: false,
1321
+ type: Boolean,
1322
+ short: "f",
1323
+ description: `
1324
+ Removes various protections against unfortunate side effects, common
1325
+ mistakes, unnecessary performance degradation, and malicious input.
1326
+
1327
+ * Allow clobbering non-npm files in global installs.
1328
+ * Allow the \`npm version\` command to work on an unclean git repository.
1329
+ * Allow deleting the cache folder with \`npm cache clean\`.
1330
+ * Allow installing packages that have an \`engines\` declaration
1331
+ requiring a different version of npm.
1332
+ * Allow installing packages that have an \`engines\` declaration
1333
+ requiring a different version of \`node\`, even if \`--engine-strict\`
1334
+ is enabled.
1335
+ * Allow \`npm audit fix\` to install modules outside your stated
1336
+ dependency range (including SemVer-major changes).
1337
+ * Allow unpublishing all versions of a published package.
1338
+ * Allow conflicting peerDependencies to be installed in the root project.
1339
+ * Implicitly set \`--yes\` during \`npm init\`.
1340
+ * Allow clobbering existing values in \`npm pkg\`
1341
+ * Allow unpublishing of entire packages (not just a single version).
1342
+
1343
+ If you don't have a clear idea of what you want to do, it is strongly
1344
+ recommended that you do not use this option!
1345
+ `,
1346
+ flatten
1347
+ }),
1348
+ "foreground-scripts": new Definition("foreground-scripts", {
1349
+ default: false,
1350
+ defaultDescription: `\`false\` unless when using \`npm pack\` or \`npm publish\` where it
1351
+ defaults to \`true\``,
1352
+ type: Boolean,
1353
+ description: `
1354
+ Run all build scripts (ie, \`preinstall\`, \`install\`, and
1355
+ \`postinstall\`) scripts for installed packages in the foreground
1356
+ process, sharing standard input, output, and error with the main npm
1357
+ process.
1358
+
1359
+ Note that this will generally make installs run slower, and be much
1360
+ noisier, but can be useful for debugging.
1361
+ `,
1362
+ flatten
1363
+ }),
1364
+ "format-package-lock": new Definition("format-package-lock", {
1365
+ default: true,
1366
+ type: Boolean,
1367
+ description: `
1368
+ Format \`package-lock.json\` as a human
1369
+ readable file.
1370
+ `,
1371
+ flatten
1372
+ }),
1373
+ fund: new Definition("fund", {
1374
+ default: true,
1375
+ type: Boolean,
1376
+ description: `
1377
+ When "true" displays the message at the end of each \`npm install\`
1378
+ acknowledging the number of dependencies looking for funding.
1379
+ See [\`npm fund\`](/commands/npm-fund) for details.
1380
+ `,
1381
+ flatten
1382
+ }),
1383
+ git: new Definition("git", {
1384
+ default: "git",
1385
+ type: String,
1386
+ description: `
1387
+ The command to use for git commands. If git is installed on the
1388
+ computer, but is not in the \`PATH\`, then set this to the full path to
1389
+ the git binary.
1390
+ `,
1391
+ flatten
1392
+ }),
1393
+ "git-tag-version": new Definition("git-tag-version", {
1394
+ default: true,
1395
+ type: Boolean,
1396
+ description: `
1397
+ Tag the commit when using the \`npm version\` command. Setting this to
1398
+ false results in no commit being made at all.
1399
+ `,
1400
+ flatten
1401
+ }),
1402
+ global: new Definition("global", {
1403
+ default: false,
1404
+ type: Boolean,
1405
+ short: "g",
1406
+ description: `
1407
+ Operates in "global" mode, so that packages are installed into the
1408
+ \`prefix\` folder instead of the current working directory. See
1409
+ [folders](/configuring-npm/folders) for more on the differences in
1410
+ behavior.
1411
+
1412
+ * packages are installed into the \`{prefix}/lib/node_modules\` folder,
1413
+ instead of the current working directory.
1414
+ * bin files are linked to \`{prefix}/bin\`
1415
+ * man pages are linked to \`{prefix}/share/man\`
1416
+ `,
1417
+ flatten: (key, obj, flatOptions) => {
1418
+ flatten(key, obj, flatOptions);
1419
+ if (flatOptions.global) flatOptions.location = "global";
1420
+ }
1421
+ }),
1422
+ globalconfig: new Definition("globalconfig", {
1423
+ type: path,
1424
+ default: "",
1425
+ defaultDescription: `
1426
+ The global --prefix setting plus 'etc/npmrc'. For example,
1427
+ '/usr/local/etc/npmrc'
1428
+ `,
1429
+ description: `
1430
+ The config file to read for global config options.
1431
+ `,
1432
+ flatten
1433
+ }),
1434
+ "global-ignore-file": new Definition("global-ignore-file", {
1435
+ type: path,
1436
+ default: "",
1437
+ defaultDescription: `
1438
+ The global --prefix setting plus 'etc/npmignore'. For example,
1439
+ '/usr/local/etc/npmignore'
1440
+ `,
1441
+ description: `
1442
+ An additional ignore file applied during \`npm pack\` and \`npm
1443
+ publish\`, owned by the current user rather than the package. Patterns
1444
+ follow the same syntax as a package's local \`.npmignore\` file.
1445
+ Useful for keeping editor metadata (such as \`.idea/\` or \`*.iml\`)
1446
+ and scratch directories out of every package you publish, without
1447
+ adding them to each package's own ignore rules.
1448
+
1449
+ The global rules apply in addition to a package's local \`.npmignore\`.
1450
+ When a package uses a \`files\` field in its \`package.json\`, an entry
1451
+ in \`files\` that contradicts a global rule (i.e., explicitly includes
1452
+ a path the global rule would exclude) still wins.
1453
+ `,
1454
+ flatten
1455
+ }),
1456
+ "global-style": new Definition("global-style", {
1457
+ default: false,
1458
+ type: Boolean,
1459
+ description: `
1460
+ Only install direct dependencies in the top level \`node_modules\`,
1461
+ but hoist on deeper dependencies.
1462
+ Sets \`--install-strategy=shallow\`.
1463
+ `,
1464
+ deprecated: `
1465
+ This option has been deprecated in favor of \`--install-strategy=shallow\`
1466
+ `,
1467
+ flatten(key, obj, flatOptions) {
1468
+ if (obj[key]) {
1469
+ obj["install-strategy"] = "shallow";
1470
+ flatOptions.installStrategy = "shallow";
1471
+ }
1472
+ }
1473
+ }),
1474
+ heading: new Definition("heading", {
1475
+ default: "npm",
1476
+ type: String,
1477
+ description: `
1478
+ The string that starts all the debugging log output.
1479
+ `,
1480
+ flatten
1481
+ }),
1482
+ "https-proxy": new Definition("https-proxy", {
1483
+ default: null,
1484
+ type: [null, url],
1485
+ description: `
1486
+ A proxy to use for outgoing https requests. If the \`HTTPS_PROXY\` or
1487
+ \`https_proxy\` or \`HTTP_PROXY\` or \`http_proxy\` environment variables
1488
+ are set, proxy settings will be honored by the underlying
1489
+ \`make-fetch-happen\` library.
1490
+ `,
1491
+ flatten
1492
+ }),
1493
+ "if-present": new Definition("if-present", {
1494
+ default: false,
1495
+ type: Boolean,
1496
+ envExport: false,
1497
+ description: `
1498
+ If true, npm will not exit with an error code when \`run\` is
1499
+ invoked for a script that isn't defined in the \`scripts\` section of
1500
+ \`package.json\`. This option can be used when it's desirable to
1501
+ optionally run a script when it's present and fail if the script fails.
1502
+ This is useful, for example, when running scripts that may only apply for
1503
+ some builds in an otherwise generic CI setup.
1504
+ `,
1505
+ flatten
1506
+ }),
1507
+ "ignore-extension": new Definition("ignore-extension", {
1508
+ default: false,
1509
+ type: Boolean,
1510
+ description: `
1511
+ If true, npm does not import or execute a root \`.npm-extension.mjs\` /
1512
+ \`.npm-extension.cjs\` file (or one selected via \`extension-file\`).
1513
+ \`ignore-scripts\` implies \`ignore-extension\`, since both disable
1514
+ root-owned install-time code.
1515
+ `,
1516
+ flatten
1517
+ }),
1518
+ "ignore-scripts": new Definition("ignore-scripts", {
1519
+ default: false,
1520
+ type: Boolean,
1521
+ description: `
1522
+ If true, npm does not run scripts specified in package.json files.
1523
+
1524
+ Note that commands explicitly intended to run a particular script, such
1525
+ as \`npm start\`, \`npm stop\`, \`npm restart\`, \`npm test\`, and \`npm
1526
+ run\` will still run their intended script if \`ignore-scripts\` is
1527
+ set, but they will *not* run any pre- or post-scripts.
1528
+
1529
+ Setting \`ignore-scripts\` also disables \`.npm-extension\` execution,
1530
+ as if \`ignore-extension\` were set.
1531
+ `,
1532
+ flatten(key, obj, flatOptions) {
1533
+ flatOptions.ignoreScripts = obj["ignore-scripts"];
1534
+ if (obj["ignore-scripts"]) flatOptions.ignoreExtension = true;
1535
+ }
1536
+ }),
1537
+ include: new Definition("include", {
1538
+ default: [],
1539
+ type: [
1540
+ Array,
1541
+ "prod",
1542
+ "dev",
1543
+ "optional",
1544
+ "peer"
1545
+ ],
1546
+ description: `
1547
+ Option that allows for defining which types of dependencies to install.
1548
+
1549
+ This is the inverse of \`--omit=<type>\`.
1550
+
1551
+ Dependency types specified in \`--include\` will not be omitted,
1552
+ regardless of the order in which omit/include are specified on the
1553
+ command-line.
1554
+ `,
1555
+ flatten(key, obj, flatOptions) {
1556
+ definitions.omit.flatten("omit", obj, flatOptions);
1557
+ }
1558
+ }),
1559
+ "include-staged": new Definition("include-staged", {
1560
+ default: false,
1561
+ type: Boolean,
1562
+ description: `
1563
+ Allow installing "staged" published packages, as defined by [npm RFC PR
1564
+ #92](https://github.com/npm/rfcs/pull/92).
1565
+
1566
+ This is experimental, and not implemented by the npm public registry.
1567
+ `,
1568
+ flatten
1569
+ }),
1570
+ "include-workspace-root": new Definition("include-workspace-root", {
1571
+ default: false,
1572
+ type: Boolean,
1573
+ envExport: false,
1574
+ description: `
1575
+ Include the workspace root when workspaces are enabled for a command.
1576
+
1577
+ When false, specifying individual workspaces via the \`workspace\` config,
1578
+ or all workspaces via the \`workspaces\` flag, will cause npm to operate only
1579
+ on the specified workspaces, and not on the root project.
1580
+ `,
1581
+ flatten
1582
+ }),
1583
+ "include-attestations": new Definition("include-attestations", {
1584
+ default: false,
1585
+ type: Boolean,
1586
+ description: `
1587
+ When used with \`npm audit signatures --json\`, includes the full
1588
+ sigstore attestation bundles in the JSON output for each verified
1589
+ package. The bundles contain DSSE envelopes, verification material,
1590
+ and transparency log entries.
1591
+ `,
1592
+ flatten
1593
+ }),
1594
+ "init-author-email": new Definition("init-author-email", {
1595
+ default: "",
1596
+ hint: "<email>",
1597
+ type: String,
1598
+ description: `
1599
+ The value \`npm init\` should use by default for the package author's
1600
+ email.
1601
+ `
1602
+ }),
1603
+ "init-author-name": new Definition("init-author-name", {
1604
+ default: "",
1605
+ hint: "<name>",
1606
+ type: String,
1607
+ description: `
1608
+ The value \`npm init\` should use by default for the package author's name.
1609
+ `
1610
+ }),
1611
+ "init-author-url": new Definition("init-author-url", {
1612
+ default: "",
1613
+ type: ["", url],
1614
+ hint: "<url>",
1615
+ description: `
1616
+ The value \`npm init\` should use by default for the package author's homepage.
1617
+ `
1618
+ }),
1619
+ "init-license": new Definition("init-license", {
1620
+ default: "",
1621
+ hint: "<license>",
1622
+ type: String,
1623
+ description: `
1624
+ The value \`npm init\` should use by default for the package license.
1625
+ If not set, the license field will be omitted from new packages.
1626
+ `
1627
+ }),
1628
+ "init-module": new Definition("init-module", {
1629
+ default: "~/.npm-init.js",
1630
+ type: path,
1631
+ hint: "<module>",
1632
+ description: `
1633
+ A module that will be loaded by the \`npm init\` command. See the
1634
+ documentation for the
1635
+ [init-package-json](https://github.com/npm/init-package-json) module for
1636
+ more information, or [npm init](/commands/npm-init).
1637
+ `
1638
+ }),
1639
+ "init-type": new Definition("init-type", {
1640
+ default: "commonjs",
1641
+ type: String,
1642
+ hint: "<type>",
1643
+ description: `
1644
+ The value that \`npm init\` should use by default for the package.json type field.
1645
+ `
1646
+ }),
1647
+ "init-version": new Definition("init-version", {
1648
+ default: "1.0.0",
1649
+ type: Semver,
1650
+ hint: "<version>",
1651
+ description: `
1652
+ The value that \`npm init\` should use by default for the package
1653
+ version number, if not already set in package.json.
1654
+ `
1655
+ }),
1656
+ "init-private": new Definition("init-private", {
1657
+ default: false,
1658
+ type: Boolean,
1659
+ description: `
1660
+ The value \`npm init\` should use by default for the package's private flag.
1661
+ `,
1662
+ flatten
1663
+ }),
1664
+ "init.author.email": new Definition("init.author.email", {
1665
+ default: "",
1666
+ type: String,
1667
+ deprecated: `
1668
+ Use \`--init-author-email\` instead.`,
1669
+ description: `
1670
+ Alias for \`--init-author-email\`
1671
+ `
1672
+ }),
1673
+ "init.author.name": new Definition("init.author.name", {
1674
+ default: "",
1675
+ type: String,
1676
+ deprecated: `
1677
+ Use \`--init-author-name\` instead.
1678
+ `,
1679
+ description: `
1680
+ Alias for \`--init-author-name\`
1681
+ `
1682
+ }),
1683
+ "init.author.url": new Definition("init.author.url", {
1684
+ default: "",
1685
+ type: ["", url],
1686
+ deprecated: `
1687
+ Use \`--init-author-url\` instead.
1688
+ `,
1689
+ description: `
1690
+ Alias for \`--init-author-url\`
1691
+ `
1692
+ }),
1693
+ "init.license": new Definition("init.license", {
1694
+ default: "",
1695
+ type: String,
1696
+ deprecated: `
1697
+ Use \`--init-license\` instead.
1698
+ `,
1699
+ description: `
1700
+ Alias for \`--init-license\`
1701
+ `
1702
+ }),
1703
+ "init.module": new Definition("init.module", {
1704
+ default: "~/.npm-init.js",
1705
+ type: path,
1706
+ deprecated: `
1707
+ Use \`--init-module\` instead.
1708
+ `,
1709
+ description: `
1710
+ Alias for \`--init-module\`
1711
+ `
1712
+ }),
1713
+ "init.version": new Definition("init.version", {
1714
+ default: "1.0.0",
1715
+ type: Semver,
1716
+ deprecated: `
1717
+ Use \`--init-version\` instead.
1718
+ `,
1719
+ description: `
1720
+ Alias for \`--init-version\`
1721
+ `
1722
+ }),
1723
+ "install-links": new Definition("install-links", {
1724
+ default: false,
1725
+ type: Boolean,
1726
+ description: `
1727
+ When set file: protocol dependencies will be packed and installed as
1728
+ regular dependencies instead of creating a symlink. This option has
1729
+ no effect on workspaces.
1730
+ `,
1731
+ flatten
1732
+ }),
1733
+ "install-strategy": new Definition("install-strategy", {
1734
+ default: "hoisted",
1735
+ type: [
1736
+ "hoisted",
1737
+ "nested",
1738
+ "shallow",
1739
+ "linked"
1740
+ ],
1741
+ description: `
1742
+ Sets the strategy for installing packages in node_modules.
1743
+ hoisted (default): Install non-duplicated in top-level, and duplicated as
1744
+ necessary within directory structure.
1745
+ nested: (formerly --legacy-bundling) install in place, no hoisting.
1746
+ shallow (formerly --global-style) only install direct deps at top-level.
1747
+ linked: install in node_modules/.store, link in place, unhoisted.
1748
+
1749
+ We recommend that package authors use \`--install-strategy=linked\`
1750
+ during development to catch undeclared ("phantom") dependencies before
1751
+ publishing: the isolated layout only exposes a package's declared
1752
+ dependencies, so an \`import\` of a package that was never added to
1753
+ \`package.json\` can fail instead of resolving by accident and shipping
1754
+ broken. See [Catching undeclared ("phantom")
1755
+ dependencies](/using-npm/developers#catching-undeclared-phantom-dependencies).
1756
+ `,
1757
+ flatten
1758
+ }),
1759
+ json: new Definition("json", {
1760
+ default: false,
1761
+ type: Boolean,
1762
+ description: `
1763
+ Whether or not to output JSON data, rather than the normal output.
1764
+
1765
+ * In \`npm pkg set\` it enables parsing set values with JSON.parse()
1766
+ before saving them to your \`package.json\`.
1767
+
1768
+ Not supported by all npm commands.
1769
+ `,
1770
+ flatten
1771
+ }),
1772
+ key: new Definition("key", {
1773
+ default: null,
1774
+ type: [null, String],
1775
+ description: `
1776
+ A client key to pass when accessing the registry. Values should be in
1777
+ PEM format with newlines replaced by the string "\\n". For example:
1778
+
1779
+ \`\`\`ini
1780
+ key="-----BEGIN PRIVATE KEY-----\\nXXXX\\nXXXX\\n-----END PRIVATE KEY-----"
1781
+ \`\`\`
1782
+
1783
+ It is _not_ the path to a key file, though you can set a registry-scoped
1784
+ "keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem".
1785
+ `,
1786
+ deprecated: `
1787
+ \`key\` and \`cert\` are no longer used for most registry operations.
1788
+ Use registry scoped \`keyfile\` and \`certfile\` instead.
1789
+ Example:
1790
+ //other-registry.tld/:keyfile=/path/to/key.pem
1791
+ //other-registry.tld/:certfile=/path/to/cert.crt
1792
+ `,
1793
+ flatten
1794
+ }),
1795
+ "legacy-bundling": new Definition("legacy-bundling", {
1796
+ default: false,
1797
+ type: Boolean,
1798
+ description: `
1799
+ Instead of hoisting package installs in \`node_modules\`, install packages
1800
+ in the same manner that they are depended on. This may cause very deep
1801
+ directory structures and duplicate package installs as there is no
1802
+ de-duplicating.
1803
+ Sets \`--install-strategy=nested\`.
1804
+ `,
1805
+ deprecated: `
1806
+ This option has been deprecated in favor of \`--install-strategy=nested\`
1807
+ `,
1808
+ flatten(key, obj, flatOptions) {
1809
+ if (obj[key]) {
1810
+ obj["install-strategy"] = "nested";
1811
+ flatOptions.installStrategy = "nested";
1812
+ }
1813
+ }
1814
+ }),
1815
+ "legacy-peer-deps": new Definition("legacy-peer-deps", {
1816
+ default: false,
1817
+ type: Boolean,
1818
+ description: `
1819
+ Causes npm to completely ignore \`peerDependencies\` when building a
1820
+ package tree, as in npm versions 3 through 6.
1821
+
1822
+ If a package cannot be installed because of overly strict
1823
+ \`peerDependencies\` that collide, it provides a way to move forward
1824
+ resolving the situation.
1825
+
1826
+ This differs from \`--omit=peer\`, in that \`--omit=peer\` will avoid
1827
+ unpacking \`peerDependencies\` on disk, but will still design a tree such
1828
+ that \`peerDependencies\` _could_ be unpacked in a correct place.
1829
+
1830
+ Use of \`legacy-peer-deps\` is not recommended, as it will not enforce
1831
+ the \`peerDependencies\` contract that meta-dependencies may rely on.
1832
+ `,
1833
+ flatten
1834
+ }),
1835
+ libc: new Definition("libc", {
1836
+ default: null,
1837
+ type: [null, String],
1838
+ description: `
1839
+ Override libc of native modules to install.
1840
+ Acceptable values are same as \`libc\` field of package.json
1841
+ `,
1842
+ flatten
1843
+ }),
1844
+ link: new Definition("link", {
1845
+ default: false,
1846
+ type: Boolean,
1847
+ description: `
1848
+ Used with \`npm ls\`, limiting output to only those packages that are
1849
+ linked.
1850
+ `
1851
+ }),
1852
+ "local-address": new Definition("local-address", {
1853
+ default: null,
1854
+ type: getLocalAddresses(),
1855
+ typeDescription: "IP Address",
1856
+ description: `
1857
+ The IP address of the local interface to use when making connections to
1858
+ the npm registry. Must be IPv4 in versions of Node prior to 0.12.
1859
+ `,
1860
+ flatten
1861
+ }),
1862
+ location: new Definition("location", {
1863
+ default: "user",
1864
+ short: "L",
1865
+ type: [
1866
+ "global",
1867
+ "user",
1868
+ "project"
1869
+ ],
1870
+ defaultDescription: `
1871
+ "user" unless \`--global\` is passed, which will also set this value to "global"
1872
+ `,
1873
+ description: `
1874
+ When passed to \`npm config\` this refers to which config file to use.
1875
+
1876
+ When set to "global" mode, packages are installed into the \`prefix\` folder
1877
+ instead of the current working directory. See
1878
+ [folders](/configuring-npm/folders) for more on the differences in behavior.
1879
+
1880
+ * packages are installed into the \`{prefix}/lib/node_modules\` folder,
1881
+ instead of the current working directory.
1882
+ * bin files are linked to \`{prefix}/bin\`
1883
+ * man pages are linked to \`{prefix}/share/man\`
1884
+ `,
1885
+ flatten: (key, obj, flatOptions) => {
1886
+ flatten(key, obj, flatOptions);
1887
+ if (flatOptions.global) flatOptions.location = "global";
1888
+ if (obj.location === "global") flatOptions.global = true;
1889
+ }
1890
+ }),
1891
+ "lockfile-version": new Definition("lockfile-version", {
1892
+ default: null,
1893
+ type: [
1894
+ null,
1895
+ 1,
1896
+ 2,
1897
+ 3,
1898
+ "1",
1899
+ "2",
1900
+ "3"
1901
+ ],
1902
+ defaultDescription: `
1903
+ Version 3 if no lockfile, auto-converting v1 lockfiles to v3; otherwise,
1904
+ maintain current lockfile version.`,
1905
+ description: `
1906
+ Set the lockfile format version to be used in package-lock.json files.
1907
+ Possible options are:
1908
+
1909
+ 1: The lockfile version used by npm versions 5 and 6. Lacks some data that
1910
+ is used during the install, resulting in slower and possibly less
1911
+ deterministic installs. Prevents lockfile churn when interoperating with
1912
+ older npm versions.
1913
+
1914
+ 2: The default lockfile version used by npm version 7 and 8. Includes both
1915
+ the version 1 lockfile data and version 3 lockfile data, for maximum
1916
+ determinism and interoperability, at the expense of more bytes on disk.
1917
+
1918
+ 3: Only the new lockfile information introduced in npm version 7. Smaller
1919
+ on disk than lockfile version 2, but not interoperable with older npm
1920
+ versions. Ideal if all users are on npm version 7 and higher.
1921
+ `,
1922
+ flatten: (key, obj, flatOptions) => {
1923
+ flatOptions.lockfileVersion = obj[key] && parseInt(obj[key], 10);
1924
+ }
1925
+ }),
1926
+ loglevel: new Definition("loglevel", {
1927
+ default: "notice",
1928
+ type: [
1929
+ "silent",
1930
+ "error",
1931
+ "warn",
1932
+ "notice",
1933
+ "http",
1934
+ "info",
1935
+ "verbose",
1936
+ "silly"
1937
+ ],
1938
+ description: `
1939
+ What level of logs to report. All logs are written to a debug log,
1940
+ with the path to that file printed if the execution of a command fails.
1941
+
1942
+ Any logs of a higher level than the setting are shown. The default is
1943
+ "notice".
1944
+
1945
+ See also the \`foreground-scripts\` config.
1946
+ `,
1947
+ flatten(key, obj, flatOptions) {
1948
+ flatOptions.silent = obj[key] === "silent";
1949
+ }
1950
+ }),
1951
+ "logs-dir": new Definition("logs-dir", {
1952
+ default: null,
1953
+ type: [null, path],
1954
+ defaultDescription: `
1955
+ A directory named \`_logs\` inside the cache
1956
+ `,
1957
+ description: `
1958
+ The location of npm's log directory. See [\`npm
1959
+ logging\`](/using-npm/logging) for more information.
1960
+ `
1961
+ }),
1962
+ "logs-max": new Definition("logs-max", {
1963
+ default: 10,
1964
+ type: Number,
1965
+ description: `
1966
+ The maximum number of log files to store.
1967
+
1968
+ If set to 0, no log files will be written for the current run.
1969
+ `
1970
+ }),
1971
+ long: new Definition("long", {
1972
+ default: false,
1973
+ type: Boolean,
1974
+ short: "l",
1975
+ description: `
1976
+ Show extended information in \`ls\`, \`search\`, and \`help-search\`.
1977
+ `
1978
+ }),
1979
+ name: new Definition("name", {
1980
+ default: null,
1981
+ type: [null, String],
1982
+ hint: "<name>",
1983
+ description: `
1984
+ When creating a Granular Access Token with \`npm token create\`,
1985
+ this sets the name/description for the token.
1986
+ `,
1987
+ flatten
1988
+ }),
1989
+ maxsockets: new Definition("maxsockets", {
1990
+ default: 15,
1991
+ type: Number,
1992
+ description: `
1993
+ The maximum number of connections to use per origin (protocol/host/port
1994
+ combination).
1995
+ `,
1996
+ flatten(key, obj, flatOptions) {
1997
+ flatOptions.maxSockets = obj[key];
1998
+ }
1999
+ }),
2000
+ message: new Definition("message", {
2001
+ default: "%s",
2002
+ type: String,
2003
+ short: "m",
2004
+ description: `
2005
+ Commit message which is used by \`npm version\` when creating version commit.
2006
+
2007
+ Any "%s" in the message will be replaced with the version number.
2008
+ `,
2009
+ flatten
2010
+ }),
2011
+ "min-release-age": new Definition("min-release-age", {
2012
+ default: null,
2013
+ hint: "<days>",
2014
+ type: [null, Number],
2015
+ envExport: false,
2016
+ description: `
2017
+ If set, npm will build the npm tree such that only versions that were
2018
+ available more than the given number of days ago will be installed. If
2019
+ there are no versions available for the current set of dependencies, the
2020
+ command will error.
2021
+
2022
+ This flag is a complement to \`before\`, which accepts an exact date
2023
+ instead of a relative number of days. The two may coexist (e.g.
2024
+ \`min-release-age\` in your \`.npmrc\` is preserved when npm internally
2025
+ spawns a sub-process with \`--before\` while preparing a \`git:\` or
2026
+ \`github:\` dependency); when both apply, \`before\` wins within a
2027
+ single source and across sources the standard precedence rules apply.
2028
+
2029
+ When this window stops \`npm audit fix\` from installing a patched
2030
+ version (because the fix was published too recently), npm keeps the
2031
+ package at its vulnerable version, warns that the fix was blocked, and
2032
+ exits with a non-zero code. To install the fix, add the package to
2033
+ \`min-release-age-exclude\`, or relax \`min-release-age\` or \`before\`.
2034
+
2035
+ Packages whose names match \`min-release-age-exclude\` are exempt from
2036
+ this filter.
2037
+ `,
2038
+ flatten: (key, obj, flatOptions) => {
2039
+ const age = obj["min-release-age"];
2040
+ if (age != null && !Object.hasOwn(obj, "before")) flatOptions.before = age ? /* @__PURE__ */ new Date(Date.now() - 864e5 * age) : null;
2041
+ }
2042
+ }),
2043
+ "min-release-age-exclude": new Definition("min-release-age-exclude", {
2044
+ default: [],
2045
+ hint: "<pkg|glob>",
2046
+ type: [Array, String],
2047
+ envExport: false,
2048
+ description: `
2049
+ A list of package names or \`minimatch\` glob patterns that are exempt
2050
+ from the \`min-release-age\` (and \`before\`) filter. A matching package
2051
+ can always resolve to its newest version, even when a release-age window
2052
+ is set.
2053
+
2054
+ For example, to apply a release-age window to third-party dependencies
2055
+ while letting internally maintained packages update immediately:
2056
+
2057
+ \`\`\`
2058
+ min-release-age=7
2059
+ min-release-age-exclude[]=@myorg/*
2060
+ min-release-age-exclude[]=my-internal-pkg
2061
+ \`\`\`
2062
+
2063
+ Only the named package is exempt; its own dependencies still follow the
2064
+ release-age policy unless they also match a pattern. Patterns match
2065
+ against the package name, so \`@myorg/*\` matches \`@myorg/shared-utils\`.
2066
+
2067
+ Excluding a package does not change which registry it is fetched from. You
2068
+ should own your private scope on the public registry so that nobody else
2069
+ can publish a package with the same name.
2070
+ `,
2071
+ flatten: (key, obj, flatOptions) => {
2072
+ const list = obj[key].flatMap((v) => String(v).split(",")).map((v) => v.trim()).filter(Boolean);
2073
+ flatOptions.minReleaseAgeExclude = [...new Set(list)];
2074
+ }
2075
+ }),
2076
+ "node-gyp": new Definition("node-gyp", {
2077
+ default: (() => {
2078
+ try {
2079
+ return __require.resolve("node-gyp/bin/node-gyp.js");
2080
+ } catch {
2081
+ return "";
2082
+ }
2083
+ })(),
2084
+ defaultDescription: `
2085
+ The path to the node-gyp bin that ships with npm
2086
+ `,
2087
+ type: path,
2088
+ description: `
2089
+ This is the location of the "node-gyp" bin. By default it uses one that ships with npm itself.
2090
+
2091
+ You can use this config to specify your own "node-gyp" to run when it is required to build a package.
2092
+ `,
2093
+ flatten
2094
+ }),
2095
+ "node-options": new Definition("node-options", {
2096
+ default: null,
2097
+ type: [null, String],
2098
+ description: `
2099
+ Options to pass through to Node.js via the \`NODE_OPTIONS\` environment
2100
+ variable. This does not impact how npm itself is executed but it does
2101
+ impact how lifecycle scripts are called.
2102
+ `
2103
+ }),
2104
+ noproxy: new Definition("noproxy", {
2105
+ default: "",
2106
+ defaultDescription: `
2107
+ The value of the NO_PROXY environment variable
2108
+ `,
2109
+ type: [String, Array],
2110
+ description: `
2111
+ Domain extensions that should bypass any proxies.
2112
+
2113
+ Also accepts a comma-delimited string.
2114
+ `,
2115
+ flatten(key, obj, flatOptions) {
2116
+ if (Array.isArray(obj[key])) flatOptions.noProxy = obj[key].join(",");
2117
+ else flatOptions.noProxy = obj[key];
2118
+ }
2119
+ }),
2120
+ offline: new Definition("offline", {
2121
+ default: false,
2122
+ type: Boolean,
2123
+ description: `
2124
+ Force offline mode: no network requests will be done during install. To allow
2125
+ the CLI to fill in missing cache data, see \`--prefer-offline\`.
2126
+ `,
2127
+ flatten
2128
+ }),
2129
+ omit: new Definition("omit", {
2130
+ default: process.env.NODE_ENV === "production" ? ["dev"] : [],
2131
+ defaultDescription: `
2132
+ 'dev' if the \`NODE_ENV\` environment variable is set to 'production';
2133
+ otherwise, empty.
2134
+ `,
2135
+ type: [
2136
+ Array,
2137
+ "dev",
2138
+ "optional",
2139
+ "peer"
2140
+ ],
2141
+ description: `
2142
+ Dependency types to omit from the installation tree on disk.
2143
+
2144
+ Note that these dependencies _are_ still resolved and added to the
2145
+ \`package-lock.json\` file. They are just
2146
+ not physically installed on disk.
2147
+
2148
+ If a package type appears in both the \`--include\` and \`--omit\`
2149
+ lists, then it will be included.
2150
+
2151
+ If the resulting omit list includes \`'dev'\`, then the \`NODE_ENV\`
2152
+ environment variable will be set to \`'production'\` for all lifecycle
2153
+ scripts.
2154
+ `,
2155
+ flatten(key, obj, flatOptions) {
2156
+ flatOptions.omit = buildOmitList(obj);
2157
+ }
2158
+ }),
2159
+ "omit-lockfile-registry-resolved": new Definition("omit-lockfile-registry-resolved", {
2160
+ default: false,
2161
+ type: Boolean,
2162
+ description: `
2163
+ This option causes npm to create lock files without a \`resolved\` key for
2164
+ registry dependencies. Subsequent installs will need to resolve tarball
2165
+ endpoints with the configured registry, likely resulting in a longer install
2166
+ time.
2167
+ `,
2168
+ flatten
2169
+ }),
2170
+ only: new Definition("only", {
2171
+ default: null,
2172
+ type: [
2173
+ null,
2174
+ "prod",
2175
+ "production"
2176
+ ],
2177
+ deprecated: `
2178
+ Use \`--omit=dev\` to omit dev dependencies from the install.
2179
+ `,
2180
+ description: `
2181
+ When set to \`prod\` or \`production\`, this is an alias for
2182
+ \`--omit=dev\`.
2183
+ `,
2184
+ flatten(key, obj, flatOptions) {
2185
+ definitions.omit.flatten("omit", obj, flatOptions);
2186
+ }
2187
+ }),
2188
+ orgs: new Definition("orgs", {
2189
+ default: null,
2190
+ type: [
2191
+ null,
2192
+ String,
2193
+ Array
2194
+ ],
2195
+ description: `
2196
+ When creating a Granular Access Token with \`npm token create\`,
2197
+ this limits the token access to specific organizations.
2198
+ `,
2199
+ flatten
2200
+ }),
2201
+ optional: new Definition("optional", {
2202
+ default: null,
2203
+ type: [null, Boolean],
2204
+ deprecated: `
2205
+ Use \`--omit=optional\` to exclude optional dependencies, or
2206
+ \`--include=optional\` to include them.
2207
+
2208
+ Default value does install optional deps unless otherwise omitted.
2209
+ `,
2210
+ description: `
2211
+ Alias for --include=optional or --omit=optional
2212
+ `,
2213
+ flatten(key, obj, flatOptions) {
2214
+ definitions.omit.flatten("omit", obj, flatOptions);
2215
+ }
2216
+ }),
2217
+ os: new Definition("os", {
2218
+ default: null,
2219
+ type: [null, String],
2220
+ description: `
2221
+ Override OS of native modules to install.
2222
+ Acceptable values are same as \`os\` field of package.json,
2223
+ which comes from \`process.platform\`.
2224
+ `,
2225
+ flatten
2226
+ }),
2227
+ otp: new Definition("otp", {
2228
+ default: null,
2229
+ type: [null, String],
2230
+ description: `
2231
+ This is a one-time password from a two-factor authenticator. It's needed
2232
+ when publishing or changing package permissions with \`npm access\`.
2233
+
2234
+ If not set, and a registry response fails with a challenge for a one-time
2235
+ password, npm will prompt on the command line for one.
2236
+ `,
2237
+ flatten(key, obj, flatOptions) {
2238
+ flatten(key, obj, flatOptions);
2239
+ if (obj.otp) {
2240
+ obj["auth-type"] = "legacy";
2241
+ flatten("auth-type", obj, flatOptions);
2242
+ }
2243
+ }
2244
+ }),
2245
+ package: new Definition("package", {
2246
+ default: [],
2247
+ hint: "<package-spec>",
2248
+ type: [String, Array],
2249
+ description: `
2250
+ The package or packages to install for [\`npm exec\`](/commands/npm-exec)
2251
+ `,
2252
+ flatten
2253
+ }),
2254
+ "package-lock": new Definition("package-lock", {
2255
+ default: true,
2256
+ type: Boolean,
2257
+ description: `
2258
+ If set to false, then ignore \`package-lock.json\` files when installing.
2259
+ This will also prevent _writing_ \`package-lock.json\` if \`save\` is
2260
+ true.
2261
+ `,
2262
+ flatten: (key, obj, flatOptions) => {
2263
+ flatten(key, obj, flatOptions);
2264
+ if (flatOptions.packageLockOnly) flatOptions.packageLock = true;
2265
+ }
2266
+ }),
2267
+ "package-lock-only": new Definition("package-lock-only", {
2268
+ default: false,
2269
+ type: Boolean,
2270
+ description: `
2271
+ If set to true, the current operation will only use the \`package-lock.json\`,
2272
+ ignoring \`node_modules\`.
2273
+
2274
+ For \`update\` this means only the \`package-lock.json\` will be updated,
2275
+ instead of checking \`node_modules\` and downloading dependencies.
2276
+
2277
+ For \`list\` this means the output will be based on the tree described by the
2278
+ \`package-lock.json\`, rather than the contents of \`node_modules\`.
2279
+ `,
2280
+ flatten: (key, obj, flatOptions) => {
2281
+ flatten(key, obj, flatOptions);
2282
+ if (flatOptions.packageLockOnly) flatOptions.packageLock = true;
2283
+ }
2284
+ }),
2285
+ "pack-destination": new Definition("pack-destination", {
2286
+ default: ".",
2287
+ type: String,
2288
+ description: `
2289
+ Directory in which \`npm pack\` will save tarballs.
2290
+ `,
2291
+ flatten
2292
+ }),
2293
+ packages: new Definition("packages", {
2294
+ default: [],
2295
+ type: [
2296
+ null,
2297
+ String,
2298
+ Array
2299
+ ],
2300
+ description: `
2301
+ When creating a Granular Access Token with \`npm token create\`,
2302
+ this limits the token access to specific packages.
2303
+ `,
2304
+ flatten
2305
+ }),
2306
+ "patches-dir": new Definition("patches-dir", {
2307
+ default: "patches",
2308
+ type: String,
2309
+ description: `
2310
+ The directory, relative to the project root, where \`npm patch commit\`
2311
+ writes patch files for \`patchedDependencies\`.
2312
+ `,
2313
+ flatten
2314
+ }),
2315
+ "allow-unused-patches": new Definition("allow-unused-patches", {
2316
+ default: false,
2317
+ type: Boolean,
2318
+ description: `
2319
+ Install even when a registered patch in \`patchedDependencies\` matches no
2320
+ installed package. Does not silence patch apply failures.
2321
+
2322
+ This flag is only honored when passed on the command line; it is ignored
2323
+ in \`.npmrc\` and environment variables, and rejected by \`npm ci\`.
2324
+ `
2325
+ }),
2326
+ "ignore-patch-failures": new Definition("ignore-patch-failures", {
2327
+ default: false,
2328
+ type: Boolean,
2329
+ description: `
2330
+ Install even when a registered patch fails to apply, with a warning per
2331
+ failure. Intended for incident response only.
2332
+
2333
+ This flag is only honored when passed on the command line; it is ignored
2334
+ in \`.npmrc\` and environment variables, and rejected by \`npm ci\`.
2335
+ `
2336
+ }),
2337
+ "edit-dir": new Definition("edit-dir", {
2338
+ default: null,
2339
+ type: [null, path],
2340
+ description: `
2341
+ Override the temporary directory used by \`npm patch add\` to prepare a
2342
+ package for editing.
2343
+ `
2344
+ }),
2345
+ "ignore-existing": new Definition("ignore-existing", {
2346
+ default: false,
2347
+ type: Boolean,
2348
+ description: `
2349
+ With \`npm patch add\`, discard a previous unfinished edit directory and
2350
+ start fresh.
2351
+ `
2352
+ }),
2353
+ "keep-edit-dir": new Definition("keep-edit-dir", {
2354
+ default: false,
2355
+ type: Boolean,
2356
+ description: `
2357
+ With \`npm patch commit\`, do not remove the edit directory after
2358
+ committing the patch.
2359
+ `
2360
+ }),
2361
+ parseable: new Definition("parseable", {
2362
+ default: false,
2363
+ type: Boolean,
2364
+ short: "p",
2365
+ description: `
2366
+ Output parseable results from commands that write to standard output. For
2367
+ \`npm search\`, this will be tab-separated table format.
2368
+ `,
2369
+ flatten
2370
+ }),
2371
+ "allow-scripts-pending": new Definition("allow-scripts-pending", {
2372
+ default: false,
2373
+ type: Boolean,
2374
+ description: `
2375
+ List packages with install scripts that are not yet covered by the
2376
+ \`allowScripts\` policy, without modifying \`package.json\`. Only
2377
+ meaningful for \`npm approve-scripts\`.
2378
+ `,
2379
+ flatten
2380
+ }),
2381
+ "allow-scripts-pin": new Definition("allow-scripts-pin", {
2382
+ default: true,
2383
+ type: Boolean,
2384
+ description: `
2385
+ Write pinned (\`pkg@version\`) entries when approving install scripts.
2386
+ Set to \`false\` to write name-only entries that allow any version.
2387
+ Has no effect on \`npm deny-scripts\`, which always writes name-only
2388
+ entries regardless of this setting.
2389
+ `,
2390
+ flatten
2391
+ }),
2392
+ "prefer-dedupe": new Definition("prefer-dedupe", {
2393
+ default: false,
2394
+ type: Boolean,
2395
+ description: `
2396
+ Prefer to deduplicate packages if possible, rather than
2397
+ choosing a newer version of a dependency.
2398
+ `,
2399
+ flatten
2400
+ }),
2401
+ "prefer-offline": new Definition("prefer-offline", {
2402
+ default: false,
2403
+ type: Boolean,
2404
+ description: `
2405
+ If true, staleness checks for cached data will be bypassed, but missing
2406
+ data will be requested from the server. To force full offline mode, use
2407
+ \`--offline\`.
2408
+ `,
2409
+ flatten
2410
+ }),
2411
+ "prefer-online": new Definition("prefer-online", {
2412
+ default: false,
2413
+ type: Boolean,
2414
+ description: `
2415
+ If true, staleness checks for cached data will be forced, making the CLI
2416
+ look for updates immediately even for fresh package data.
2417
+ `,
2418
+ flatten
2419
+ }),
2420
+ prefix: new Definition("prefix", {
2421
+ type: path,
2422
+ short: "C",
2423
+ default: "",
2424
+ defaultDescription: `
2425
+ In global mode, the folder where the node executable is installed.
2426
+ Otherwise, the nearest parent folder containing either a package.json
2427
+ file or a node_modules folder.
2428
+ `,
2429
+ description: `
2430
+ The location to install global items. If set on the command line, then
2431
+ it forces non-global commands to run in the specified folder.
2432
+ `
2433
+ }),
2434
+ preid: new Definition("preid", {
2435
+ default: "",
2436
+ hint: "prerelease-id",
2437
+ type: String,
2438
+ description: `
2439
+ The "prerelease identifier" to use as a prefix for the "prerelease" part
2440
+ of a semver. Like the \`rc\` in \`1.2.0-rc.8\`.
2441
+ `,
2442
+ flatten
2443
+ }),
2444
+ production: new Definition("production", {
2445
+ default: null,
2446
+ type: [null, Boolean],
2447
+ deprecated: "Use `--omit=dev` instead.",
2448
+ description: "Alias for `--omit=dev`",
2449
+ flatten(key, obj, flatOptions) {
2450
+ definitions.omit.flatten("omit", obj, flatOptions);
2451
+ }
2452
+ }),
2453
+ progress: new Definition("progress", {
2454
+ default: !(ciInfo.isCI || !process.stderr.isTTY || !process.stdout.isTTY || process.env.TERM === "dumb"),
2455
+ defaultDescription: `
2456
+ \`true\` when not in CI and both stderr and stdout are TTYs and not in a dumb terminal
2457
+ `,
2458
+ type: Boolean,
2459
+ description: `
2460
+ When set to \`true\`, npm will display a progress bar during time
2461
+ intensive operations, if \`process.stderr\` and \`process.stdout\` are a TTY.
2462
+
2463
+ Set to \`false\` to suppress the progress bar.
2464
+ `,
2465
+ flatten(key, obj, flatOptions) {
2466
+ flatOptions.progress = !!obj.progress && !!process.stderr.isTTY && !!process.stdout.isTTY && process.env.TERM !== "dumb";
2467
+ }
2468
+ }),
2469
+ provenance: new Definition("provenance", {
2470
+ default: false,
2471
+ type: Boolean,
2472
+ exclusive: ["provenance-file"],
2473
+ description: `
2474
+ When publishing from a supported cloud CI/CD system, the package will be
2475
+ publicly linked to where it was built and published from.
2476
+ `,
2477
+ flatten
2478
+ }),
2479
+ "provenance-file": new Definition("provenance-file", {
2480
+ default: null,
2481
+ type: path,
2482
+ hint: "<file>",
2483
+ exclusive: ["provenance"],
2484
+ description: `
2485
+ When publishing, the provenance bundle at the given path will be used.
2486
+ `,
2487
+ flatten
2488
+ }),
2489
+ proxy: new Definition("proxy", {
2490
+ default: null,
2491
+ type: [
2492
+ null,
2493
+ false,
2494
+ url
2495
+ ],
2496
+ description: `
2497
+ A proxy to use for outgoing http requests. If the \`HTTP_PROXY\` or
2498
+ \`http_proxy\` environment variables are set, proxy settings will be
2499
+ honored by the underlying \`request\` library.
2500
+ `,
2501
+ flatten
2502
+ }),
2503
+ "read-only": new Definition("read-only", {
2504
+ default: false,
2505
+ type: Boolean,
2506
+ description: `
2507
+ This is used to mark a token as unable to publish when configuring
2508
+ limited access tokens with the \`npm token create\` command.
2509
+ `,
2510
+ flatten
2511
+ }),
2512
+ "rebuild-bundle": new Definition("rebuild-bundle", {
2513
+ default: true,
2514
+ type: Boolean,
2515
+ description: `
2516
+ Rebuild bundled dependencies after installation.
2517
+ `,
2518
+ flatten
2519
+ }),
2520
+ registry: new Definition("registry", {
2521
+ default: "https://registry.npmjs.org/",
2522
+ type: url,
2523
+ description: `
2524
+ The base URL of the npm registry.
2525
+ `,
2526
+ flatten
2527
+ }),
2528
+ "replace-registry-host": new Definition("replace-registry-host", {
2529
+ default: "npmjs",
2530
+ hint: "<npmjs|never|always> | hostname | url",
2531
+ type: [
2532
+ "npmjs",
2533
+ "never",
2534
+ "always",
2535
+ String
2536
+ ],
2537
+ description: `
2538
+ Defines behavior for replacing the registry host in a lockfile with the
2539
+ configured registry.
2540
+
2541
+ The default behavior is to replace package dist URLs from the default
2542
+ registry (https://registry.npmjs.org) to the configured registry. If set to
2543
+ "never", then use the registry value. If set to "always", then replace the
2544
+ registry host with the configured host every time.
2545
+
2546
+ You may also specify a bare hostname (e.g., "registry.npmjs.org") to only
2547
+ replace URLs coming from that host.
2548
+
2549
+ You may also specify a full URL including a path (e.g.,
2550
+ "https://old-registry.example.com/npm/path"). In that case, resolved URLs
2551
+ whose host and path begin with that prefix will have the entire prefix
2552
+ replaced with the configured registry URL (host and path), without
2553
+ duplicating path segments.
2554
+ `,
2555
+ flatten
2556
+ }),
2557
+ save: new Definition("save", {
2558
+ default: true,
2559
+ defaultDescription: `\`true\` unless when using \`npm update\` where it
2560
+ defaults to \`false\``,
2561
+ usage: "-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle",
2562
+ type: Boolean,
2563
+ short: "S",
2564
+ description: `
2565
+ Save installed packages to a \`package.json\` file as dependencies.
2566
+
2567
+ When used with the \`npm rm\` command, removes the dependency from
2568
+ \`package.json\`.
2569
+
2570
+ Will also prevent writing to \`package-lock.json\` if set to \`false\`.
2571
+ `,
2572
+ flatten
2573
+ }),
2574
+ "save-bundle": new Definition("save-bundle", {
2575
+ default: false,
2576
+ type: Boolean,
2577
+ short: "B",
2578
+ description: `
2579
+ If a package would be saved at install time by the use of \`--save\`,
2580
+ \`--save-dev\`, or \`--save-optional\`, then also put it in the
2581
+ \`bundleDependencies\` list.
2582
+
2583
+ Ignored if \`--save-peer\` is set, since peerDependencies cannot be bundled.
2584
+ `,
2585
+ flatten(key, obj, flatOptions) {
2586
+ flatOptions.saveBundle = obj["save-bundle"] && !obj["save-peer"];
2587
+ }
2588
+ }),
2589
+ "save-dev": new Definition("save-dev", {
2590
+ default: false,
2591
+ type: Boolean,
2592
+ short: "D",
2593
+ exclusive: [
2594
+ "save-optional",
2595
+ "save-peer",
2596
+ "save-prod"
2597
+ ],
2598
+ description: `
2599
+ Save installed packages to a package.json file as \`devDependencies\`.
2600
+ `,
2601
+ flatten(key, obj, flatOptions) {
2602
+ if (!obj[key]) {
2603
+ if (flatOptions.saveType === "dev") delete flatOptions.saveType;
2604
+ return;
2605
+ }
2606
+ flatOptions.saveType = "dev";
2607
+ }
2608
+ }),
2609
+ "save-exact": new Definition("save-exact", {
2610
+ default: false,
2611
+ type: Boolean,
2612
+ short: "E",
2613
+ description: `
2614
+ Dependencies saved to package.json will be configured with an exact
2615
+ version rather than using npm's default semver range operator.
2616
+ `,
2617
+ flatten(key, obj, flatOptions) {
2618
+ definitions["save-prefix"].flatten("save-prefix", obj, flatOptions);
2619
+ }
2620
+ }),
2621
+ "save-optional": new Definition("save-optional", {
2622
+ default: false,
2623
+ type: Boolean,
2624
+ short: "O",
2625
+ exclusive: [
2626
+ "save-dev",
2627
+ "save-peer",
2628
+ "save-prod"
2629
+ ],
2630
+ description: `
2631
+ Save installed packages to a package.json file as
2632
+ \`optionalDependencies\`.
2633
+ `,
2634
+ flatten(key, obj, flatOptions) {
2635
+ if (!obj[key]) {
2636
+ if (flatOptions.saveType === "optional") delete flatOptions.saveType;
2637
+ else if (flatOptions.saveType === "peerOptional") flatOptions.saveType = "peer";
2638
+ return;
2639
+ }
2640
+ if (flatOptions.saveType === "peerOptional") return;
2641
+ if (flatOptions.saveType === "peer") flatOptions.saveType = "peerOptional";
2642
+ else flatOptions.saveType = "optional";
2643
+ }
2644
+ }),
2645
+ "save-peer": new Definition("save-peer", {
2646
+ default: false,
2647
+ type: Boolean,
2648
+ exclusive: [
2649
+ "save-dev",
2650
+ "save-optional",
2651
+ "save-prod"
2652
+ ],
2653
+ description: `
2654
+ Save installed packages to a package.json file as \`peerDependencies\`
2655
+ `,
2656
+ flatten(key, obj, flatOptions) {
2657
+ if (!obj[key]) {
2658
+ if (flatOptions.saveType === "peer") delete flatOptions.saveType;
2659
+ else if (flatOptions.saveType === "peerOptional") flatOptions.saveType = "optional";
2660
+ return;
2661
+ }
2662
+ if (flatOptions.saveType === "peerOptional") return;
2663
+ if (flatOptions.saveType === "optional") flatOptions.saveType = "peerOptional";
2664
+ else flatOptions.saveType = "peer";
2665
+ }
2666
+ }),
2667
+ "save-prefix": new Definition("save-prefix", {
2668
+ default: "^",
2669
+ type: String,
2670
+ description: `
2671
+ Configure how versions of packages installed to a package.json file via
2672
+ \`--save\` or \`--save-dev\` get prefixed.
2673
+
2674
+ For example if a package has version \`1.2.3\`, by default its version is
2675
+ set to \`^1.2.3\` which allows minor upgrades for that package, but after
2676
+ \`npm config set save-prefix='~'\` it would be set to \`~1.2.3\` which
2677
+ only allows patch upgrades.
2678
+ `,
2679
+ flatten(key, obj, flatOptions) {
2680
+ flatOptions.savePrefix = obj["save-exact"] ? "" : obj["save-prefix"];
2681
+ obj["save-prefix"] = flatOptions.savePrefix;
2682
+ }
2683
+ }),
2684
+ "save-prod": new Definition("save-prod", {
2685
+ default: false,
2686
+ type: Boolean,
2687
+ short: "P",
2688
+ exclusive: [
2689
+ "save-dev",
2690
+ "save-optional",
2691
+ "save-peer"
2692
+ ],
2693
+ description: `
2694
+ Save installed packages into \`dependencies\` specifically. This is
2695
+ useful if a package already exists in \`devDependencies\` or
2696
+ \`optionalDependencies\`, but you want to move it to be a non-optional
2697
+ production dependency.
2698
+
2699
+ This is the default behavior if \`--save\` is true, and neither
2700
+ \`--save-dev\` or \`--save-optional\` are true.
2701
+ `,
2702
+ flatten(key, obj, flatOptions) {
2703
+ if (!obj[key]) {
2704
+ if (flatOptions.saveType === "prod") delete flatOptions.saveType;
2705
+ return;
2706
+ }
2707
+ flatOptions.saveType = "prod";
2708
+ }
2709
+ }),
2710
+ "sbom-format": new Definition("sbom-format", {
2711
+ default: null,
2712
+ type: ["cyclonedx", "spdx"],
2713
+ description: `
2714
+ SBOM format to use when generating SBOMs.
2715
+ `,
2716
+ flatten
2717
+ }),
2718
+ "sbom-type": new Definition("sbom-type", {
2719
+ default: "library",
2720
+ type: [
2721
+ "library",
2722
+ "application",
2723
+ "framework"
2724
+ ],
2725
+ description: `
2726
+ The type of package described by the generated SBOM. For SPDX, this is the
2727
+ value for the \`primaryPackagePurpose\` field. For CycloneDX, this is the
2728
+ value for the \`type\` field.
2729
+ `,
2730
+ flatten
2731
+ }),
2732
+ scope: new Definition("scope", {
2733
+ default: "",
2734
+ defaultDescription: `
2735
+ the scope of the current project, if any, or ""
2736
+ `,
2737
+ type: String,
2738
+ hint: "<@scope>",
2739
+ description: `
2740
+ Associate an operation with a scope for a scoped registry.
2741
+
2742
+ Useful when logging in to or out of a private registry:
2743
+
2744
+ \`\`\`
2745
+ # log in, linking the scope to the custom registry
2746
+ npm login --scope=@mycorp --registry=https://registry.mycorp.com
2747
+
2748
+ # log out, removing the link and the auth token
2749
+ npm logout --scope=@mycorp
2750
+ \`\`\`
2751
+
2752
+ This will cause \`@mycorp\` to be mapped to the registry for future
2753
+ installation of packages specified according to the pattern
2754
+ \`@mycorp/package\`.
2755
+
2756
+ This will also cause \`npm init\` to create a scoped package.
2757
+
2758
+ \`\`\`
2759
+ # accept all defaults, and create a package named "@foo/whatever",
2760
+ # instead of just named "whatever"
2761
+ npm init --scope=@foo --yes
2762
+ \`\`\`
2763
+ `,
2764
+ flatten(key, obj, flatOptions) {
2765
+ const value = obj[key];
2766
+ const scope = value && !/^@/.test(value) ? `@${value}` : value;
2767
+ flatOptions.scope = scope;
2768
+ flatOptions.projectScope = scope;
2769
+ }
2770
+ }),
2771
+ scopes: new Definition("scopes", {
2772
+ default: null,
2773
+ type: [
2774
+ null,
2775
+ String,
2776
+ Array
2777
+ ],
2778
+ description: `
2779
+ When creating a Granular Access Token with \`npm token create\`,
2780
+ this limits the token access to specific scopes. Provide
2781
+ a scope name (with or without @ prefix).
2782
+ `,
2783
+ flatten
2784
+ }),
2785
+ "packages-all": new Definition("packages-all", {
2786
+ default: false,
2787
+ type: Boolean,
2788
+ description: `
2789
+ When creating a Granular Access Token with \`npm token create\`,
2790
+ grants the token access to all packages instead of limiting to
2791
+ specific packages.
2792
+ `,
2793
+ flatten
2794
+ }),
2795
+ "packages-and-scopes-permission": new Definition("packages-and-scopes-permission", {
2796
+ default: null,
2797
+ type: [
2798
+ null,
2799
+ "read-only",
2800
+ "read-write",
2801
+ "no-access"
2802
+ ],
2803
+ description: `
2804
+ When creating a Granular Access Token with \`npm token create\`,
2805
+ sets the permission level for packages and scopes. Options are
2806
+ "read-only", "read-write", or "no-access".
2807
+ `,
2808
+ flatten
2809
+ }),
2810
+ "orgs-permission": new Definition("orgs-permission", {
2811
+ default: null,
2812
+ type: [
2813
+ null,
2814
+ "read-only",
2815
+ "read-write",
2816
+ "no-access"
2817
+ ],
2818
+ description: `
2819
+ When creating a Granular Access Token with \`npm token create\`,
2820
+ sets the permission level for organizations. Options are
2821
+ "read-only", "read-write", or "no-access".
2822
+ `,
2823
+ flatten
2824
+ }),
2825
+ password: new Definition("password", {
2826
+ default: null,
2827
+ type: [null, String],
2828
+ description: `
2829
+ Password for authentication. Can be provided via command line when
2830
+ creating tokens, though it's generally safer to be prompted for it.
2831
+ `,
2832
+ flatten
2833
+ }),
2834
+ "token-description": new Definition("token-description", {
2835
+ default: null,
2836
+ type: [null, String],
2837
+ description: `
2838
+ Description text for the token when using \`npm token create\`.
2839
+ `,
2840
+ flatten
2841
+ }),
2842
+ "script-shell": new Definition("script-shell", {
2843
+ default: null,
2844
+ defaultDescription: `
2845
+ '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
2846
+ `,
2847
+ type: [null, String],
2848
+ description: `
2849
+ The shell to use for scripts run with the \`npm exec\`,
2850
+ \`npm run\` and \`npm init <package-spec>\` commands.
2851
+ `,
2852
+ flatten(key, obj, flatOptions) {
2853
+ flatOptions.scriptShell = obj[key] || void 0;
2854
+ }
2855
+ }),
2856
+ searchexclude: new Definition("searchexclude", {
2857
+ default: "",
2858
+ type: String,
2859
+ description: `
2860
+ Space-separated options that limit the results from search.
2861
+ `,
2862
+ flatten(key, obj, flatOptions) {
2863
+ flatOptions.search = flatOptions.search || { limit: 20 };
2864
+ flatOptions.search.exclude = obj[key].toLowerCase();
2865
+ }
2866
+ }),
2867
+ searchlimit: new Definition("searchlimit", {
2868
+ default: 20,
2869
+ type: Number,
2870
+ description: `
2871
+ Number of items to limit search results to. Will not apply at all to
2872
+ legacy searches.
2873
+ `,
2874
+ flatten(key, obj, flatOptions) {
2875
+ flatOptions.search = flatOptions.search || {};
2876
+ flatOptions.search.limit = obj[key];
2877
+ }
2878
+ }),
2879
+ searchopts: new Definition("searchopts", {
2880
+ default: "",
2881
+ type: String,
2882
+ description: `
2883
+ Space-separated options that are always passed to search.
2884
+ `,
2885
+ flatten(key, obj, flatOptions) {
2886
+ flatOptions.search = flatOptions.search || { limit: 20 };
2887
+ flatOptions.search.opts = querystring.parse(obj[key]);
2888
+ }
2889
+ }),
2890
+ searchstaleness: new Definition("searchstaleness", {
2891
+ default: 900,
2892
+ type: Number,
2893
+ description: `
2894
+ The age of the cache, in seconds, before another registry request is made
2895
+ if using legacy search endpoint.
2896
+ `,
2897
+ flatten(key, obj, flatOptions) {
2898
+ flatOptions.search = flatOptions.search || { limit: 20 };
2899
+ flatOptions.search.staleness = obj[key];
2900
+ }
2901
+ }),
2902
+ shell: new Definition("shell", {
2903
+ default: shell,
2904
+ defaultDescription: `
2905
+ SHELL environment variable, or "bash" on Posix, or "cmd.exe" on Windows
2906
+ `,
2907
+ type: String,
2908
+ description: `
2909
+ The shell to run for the \`npm explore\` command.
2910
+ `,
2911
+ flatten
2912
+ }),
2913
+ "sign-git-commit": new Definition("sign-git-commit", {
2914
+ default: false,
2915
+ type: Boolean,
2916
+ description: `
2917
+ If set to true, then the \`npm version\` command will commit the new
2918
+ package version using \`-S\` to add a signature.
2919
+
2920
+ Note that git requires you to have set up GPG keys in your git configs
2921
+ for this to work properly.
2922
+ `,
2923
+ flatten
2924
+ }),
2925
+ "sign-git-tag": new Definition("sign-git-tag", {
2926
+ default: false,
2927
+ type: Boolean,
2928
+ description: `
2929
+ If set to true, then the \`npm version\` command will tag the version
2930
+ using \`-s\` to add a signature.
2931
+
2932
+ Note that git requires you to have set up GPG keys in your git configs
2933
+ for this to work properly.
2934
+ `,
2935
+ flatten
2936
+ }),
2937
+ "strict-peer-deps": new Definition("strict-peer-deps", {
2938
+ default: false,
2939
+ type: Boolean,
2940
+ description: `
2941
+ If set to \`true\`, and \`--legacy-peer-deps\` is not set, then _any_
2942
+ conflicting \`peerDependencies\` will be treated as an install failure,
2943
+ even if npm could reasonably guess the appropriate resolution based on
2944
+ non-peer dependency relationships.
2945
+
2946
+ By default, conflicting \`peerDependencies\` deep in the dependency graph
2947
+ will be resolved using the nearest non-peer dependency specification,
2948
+ even if doing so will result in some packages receiving a peer dependency
2949
+ outside the range set in their package's \`peerDependencies\` object.
2950
+
2951
+ When such an override is performed, a warning is printed, explaining the
2952
+ conflict and the packages involved. If \`--strict-peer-deps\` is set,
2953
+ then this warning is treated as a failure.
2954
+ `,
2955
+ flatten
2956
+ }),
2957
+ "strict-allow-scripts": new Definition("strict-allow-scripts", {
2958
+ default: false,
2959
+ type: Boolean,
2960
+ description: `
2961
+ If \`true\`, turn the install-script policy from a warning into a hard
2962
+ error: any dependency with install scripts that is not covered by
2963
+ \`allowScripts\` will fail the install instead of being blocked with a
2964
+ warning.
2965
+
2966
+ Dependencies explicitly denied with \`false\` in \`allowScripts\` are
2967
+ always silently skipped; this setting only affects unreviewed entries
2968
+ (packages with install scripts that are neither approved nor denied).
2969
+ \`--ignore-scripts\` and \`--dangerously-allow-all-scripts\` both
2970
+ override this setting.
2971
+
2972
+ Optional dependencies that cannot be installed on the current platform
2973
+ or engine (a non-matching \`os\`, \`cpu\`, or \`libc\`) are not flagged,
2974
+ because their install scripts never run.
2975
+ `,
2976
+ flatten
2977
+ }),
2978
+ "strict-npmrc": new Definition("strict-npmrc", {
2979
+ default: false,
2980
+ type: Boolean,
2981
+ description: `
2982
+ If set to \`true\`, unknown configuration keys found in \`.npmrc\` files
2983
+ are treated as a hard error instead of a warning.
2984
+
2985
+ Unknown command line flags and abbreviated flags always error regardless
2986
+ of this setting.
2987
+ `,
2988
+ flatten
2989
+ }),
2990
+ "strict-ssl": new Definition("strict-ssl", {
2991
+ default: true,
2992
+ type: Boolean,
2993
+ description: `
2994
+ Whether or not to do SSL key validation when making requests to the
2995
+ registry via https.
2996
+
2997
+ See also the \`ca\` config.
2998
+ `,
2999
+ flatten(key, obj, flatOptions) {
3000
+ flatOptions.strictSSL = obj[key];
3001
+ }
3002
+ }),
3003
+ tag: new Definition("tag", {
3004
+ default: "latest",
3005
+ type: String,
3006
+ description: `
3007
+ If you ask npm to install a package and don't tell it a specific version,
3008
+ then it will install the specified tag.
3009
+
3010
+ It is the tag added to the package@version specified in the
3011
+ \`npm dist-tag add\` command, if no explicit tag is given.
3012
+
3013
+ When used by the \`npm diff\` command, this is the tag used to fetch the
3014
+ tarball that will be compared with the local files by default.
3015
+
3016
+ If used in the \`npm publish\` command, this is the tag that will be
3017
+ added to the package submitted to the registry.
3018
+ `,
3019
+ flatten(key, obj, flatOptions) {
3020
+ flatOptions.defaultTag = obj[key];
3021
+ }
3022
+ }),
3023
+ "tag-version-prefix": new Definition("tag-version-prefix", {
3024
+ default: "v",
3025
+ type: String,
3026
+ description: `
3027
+ If set, alters the prefix used when tagging a new version when performing
3028
+ a version increment using \`npm version\`. To remove the prefix
3029
+ altogether, set it to the empty string: \`""\`.
3030
+
3031
+ Because other tools may rely on the convention that npm version tags look
3032
+ like \`v1.0.0\`, _only use this property if it is absolutely necessary_.
3033
+ In particular, use care when overriding this setting for public packages.
3034
+ `,
3035
+ flatten
3036
+ }),
3037
+ timing: new Definition("timing", {
3038
+ default: false,
3039
+ type: Boolean,
3040
+ description: `
3041
+ If true, writes timing information to a process specific json file in
3042
+ the cache or \`logs-dir\`. The file name ends with \`-timing.json\`.
3043
+
3044
+ You can quickly view it with this [json](https://npm.im/json) command
3045
+ line: \`cat ~/.npm/_logs/*-timing.json | npm exec -- json -g\`.
3046
+
3047
+ Timing information will also be reported in the terminal. To suppress this
3048
+ while still writing the timing file, use \`--silent\`.
3049
+ `
3050
+ }),
3051
+ to: new Definition("to", {
3052
+ default: null,
3053
+ hint: "<version>",
3054
+ type: [null, String],
3055
+ description: `
3056
+ Used by \`npm patch update\` to set the version to rebase a patch onto
3057
+ when it cannot be read from \`package-lock.json\` — for example an
3058
+ exact-version selector, or a version that has not been installed yet.
3059
+ `
3060
+ }),
3061
+ umask: new Definition("umask", {
3062
+ default: 0,
3063
+ type: Umask,
3064
+ description: `
3065
+ The "umask" value to use when setting the file creation mode on files and
3066
+ folders.
3067
+
3068
+ Folders and executables are given a mode which is \`0o777\` masked
3069
+ against this value. Other files are given a mode which is \`0o666\`
3070
+ masked against this value.
3071
+
3072
+ Note that the underlying system will _also_ apply its own umask value to
3073
+ files and folders that are created, and npm does not circumvent this, but
3074
+ rather adds the \`--umask\` config to it.
3075
+
3076
+ Thus, the effective default umask value on most POSIX systems is 0o22,
3077
+ meaning that folders and executables are created with a mode of 0o755 and
3078
+ other files are created with a mode of 0o644.
3079
+ `,
3080
+ flatten
3081
+ }),
3082
+ unicode: new Definition("unicode", {
3083
+ default: unicode,
3084
+ defaultDescription: `
3085
+ false on windows, true on mac/unix systems with a unicode locale, as
3086
+ defined by the \`LC_ALL\`, \`LC_CTYPE\`, or \`LANG\` environment variables.
3087
+ `,
3088
+ type: Boolean,
3089
+ description: `
3090
+ When set to true, npm uses unicode characters in the tree output. When
3091
+ false, it uses ascii characters instead of unicode glyphs.
3092
+ `,
3093
+ flatten
3094
+ }),
3095
+ "update-notifier": new Definition("update-notifier", {
3096
+ default: true,
3097
+ type: Boolean,
3098
+ description: `
3099
+ Set to false to suppress the update notification when using an older
3100
+ version of npm than the latest.
3101
+ `
3102
+ }),
3103
+ usage: new Definition("usage", {
3104
+ default: false,
3105
+ type: Boolean,
3106
+ short: [
3107
+ "?",
3108
+ "H",
3109
+ "h"
3110
+ ],
3111
+ description: `
3112
+ Show short usage output about the command specified.
3113
+ `
3114
+ }),
3115
+ "user-agent": new Definition("user-agent", {
3116
+ default: "npm/{npm-version} node/{node-version} {platform} {arch} workspaces/{workspaces} {ci}",
3117
+ type: String,
3118
+ description: `
3119
+ Sets the User-Agent request header. The following fields are replaced
3120
+ with their actual counterparts:
3121
+
3122
+ * \`{npm-version}\` - The npm version in use
3123
+ * \`{node-version}\` - The Node.js version in use
3124
+ * \`{platform}\` - The value of \`process.platform\`
3125
+ * \`{arch}\` - The value of \`process.arch\`
3126
+ * \`{workspaces}\` - Set to \`true\` if the \`workspaces\` or \`workspace\`
3127
+ options are set.
3128
+ * \`{ci}\` - The value of the \`ci-name\` config, if set, prefixed with
3129
+ \`ci/\`, or an empty string if \`ci-name\` is empty.
3130
+ `,
3131
+ flatten(key, obj, flatOptions) {
3132
+ const value = obj[key];
3133
+ const ciName = ciInfo.name?.toLowerCase().split(" ").join("-") || null;
3134
+ let subCiName = null;
3135
+ if (ciInfo.GITHUB_ACTIONS) {
3136
+ const serverUrl = (process.env.GITHUB_SERVER_URL || "").trim();
3137
+ const runnerEnv = (process.env.RUNNER_ENVIRONMENT || "").trim();
3138
+ let serverHost = "";
3139
+ try {
3140
+ serverHost = new URL(serverUrl).hostname.toLowerCase();
3141
+ } catch {
3142
+ serverHost = "";
3143
+ }
3144
+ if (serverHost === "github.com") {
3145
+ if (runnerEnv === "github-hosted") subCiName = "dotcom-hosted";
3146
+ else if (runnerEnv === "self-hosted") subCiName = "dotcom-selfhosted";
3147
+ else subCiName = "dotcom";
3148
+ } else if (serverHost === "ghe.com" || serverHost.endsWith(".ghe.com")) subCiName = "ghecom";
3149
+ else if (serverHost) subCiName = "ghes";
3150
+ }
3151
+ const ci = ciName ? `ci/${ciName}${subCiName ? `/${subCiName}` : ""}` : "";
3152
+ let inWorkspaces = false;
3153
+ if (obj.workspaces || obj.workspace && obj.workspace.length) inWorkspaces = true;
3154
+ flatOptions.userAgent = value.replace(/\{node-version\}/gi, process.version).replace(/\{npm-version\}/gi, obj["npm-version"]).replace(/\{platform\}/gi, process.platform).replace(/\{arch\}/gi, process.arch).replace(/\{workspaces\}/gi, inWorkspaces).replace(/\{ci\}/gi, ci).trim();
3155
+ process.env.npm_config_user_agent = flatOptions.userAgent;
3156
+ }
3157
+ }),
3158
+ userconfig: new Definition("userconfig", {
3159
+ default: "~/.npmrc",
3160
+ type: path,
3161
+ description: `
3162
+ The location of user-level configuration settings.
3163
+
3164
+ This may be overridden by the \`npm_config_userconfig\` environment
3165
+ variable or the \`--userconfig\` command line option, but may _not_
3166
+ be overridden by settings in the \`globalconfig\` file.
3167
+ `
3168
+ }),
3169
+ version: new Definition("version", {
3170
+ default: false,
3171
+ type: Boolean,
3172
+ short: "v",
3173
+ description: `
3174
+ If true, output the npm version and exit successfully.
3175
+
3176
+ Only relevant when specified explicitly on the command line.
3177
+ `
3178
+ }),
3179
+ versions: new Definition("versions", {
3180
+ default: false,
3181
+ type: Boolean,
3182
+ description: `
3183
+ If true, output the npm version as well as node's \`process.versions\`
3184
+ map and the version in the current working directory's \`package.json\`
3185
+ file if one exists, and exit successfully.
3186
+
3187
+ Only relevant when specified explicitly on the command line.
3188
+ `
3189
+ }),
3190
+ viewer: new Definition("viewer", {
3191
+ default: isWindows ? "browser" : "man",
3192
+ defaultDescription: `
3193
+ "man" on Posix, "browser" on Windows
3194
+ `,
3195
+ type: String,
3196
+ description: `
3197
+ The program to use to view help content.
3198
+
3199
+ Set to \`"browser"\` to view html help content in the default web browser.
3200
+ `
3201
+ }),
3202
+ which: new Definition("which", {
3203
+ default: null,
3204
+ hint: "<fundingSourceNumber>",
3205
+ type: [null, Number],
3206
+ description: `
3207
+ If there are multiple funding sources, which 1-indexed source URL to open.
3208
+ `
3209
+ }),
3210
+ workspace: new Definition("workspace", {
3211
+ default: [],
3212
+ type: [String, Array],
3213
+ hint: "<workspace-name>",
3214
+ short: "w",
3215
+ envExport: false,
3216
+ description: `
3217
+ Enable running a command in the context of the configured workspaces of the
3218
+ current project while filtering by running only the workspaces defined by
3219
+ this configuration option.
3220
+
3221
+ Valid values for the \`workspace\` config are either:
3222
+
3223
+ * Workspace names
3224
+ * Path to a workspace directory
3225
+ * Path to a parent workspace directory (will result in selecting all
3226
+ workspaces within that folder)
3227
+
3228
+ When set for the \`npm init\` command, this may be set to the folder of
3229
+ a workspace which does not yet exist, to create the folder and set it
3230
+ up as a brand new workspace within the project.
3231
+ `,
3232
+ flatten: (key, obj, flatOptions) => {
3233
+ definitions["user-agent"].flatten("user-agent", obj, flatOptions);
3234
+ }
3235
+ }),
3236
+ workspaces: new Definition("workspaces", {
3237
+ default: null,
3238
+ type: [null, Boolean],
3239
+ envExport: false,
3240
+ description: `
3241
+ Set to true to run the command in the context of **all** configured
3242
+ workspaces.
3243
+
3244
+ Explicitly setting this to false will cause commands like \`install\` to
3245
+ ignore workspaces altogether.
3246
+ When not set explicitly:
3247
+
3248
+ - Commands that operate on the \`node_modules\` tree (install, update,
3249
+ etc.) will link workspaces into the \`node_modules\` folder.
3250
+ - Commands that do other things (test, exec, publish, etc.) will operate
3251
+ on the root project, _unless_ one or more workspaces are specified in
3252
+ the \`workspace\` config.
3253
+ `,
3254
+ flatten: (key, obj, flatOptions) => {
3255
+ definitions["user-agent"].flatten("user-agent", obj, flatOptions);
3256
+ flatOptions.workspacesEnabled = obj[key] !== false;
3257
+ }
3258
+ }),
3259
+ "workspaces-update": new Definition("workspaces-update", {
3260
+ default: true,
3261
+ type: Boolean,
3262
+ description: `
3263
+ If set to true, the npm cli will run an update after operations that may
3264
+ possibly change the workspaces installed to the \`node_modules\` folder.
3265
+ `,
3266
+ flatten
3267
+ }),
3268
+ yes: new Definition("yes", {
3269
+ default: null,
3270
+ type: [null, Boolean],
3271
+ short: "y",
3272
+ description: `
3273
+ Automatically answer "yes" to any prompts that npm might print on
3274
+ the command line.
3275
+ `
3276
+ })
3277
+ };
3278
+ module.exports = definitions;
3279
+ }));
3280
+ //#endregion
3281
+ //#region ../../node_modules/.pnpm/@npmcli+config@11.0.1/node_modules/@npmcli/config/lib/definitions/index.js
3282
+ var require_definitions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3283
+ const definitions = require_definitions$1();
3284
+ const flatten = (obj, flat = {}) => {
3285
+ for (const [key, val] of Object.entries(obj)) {
3286
+ const def = definitions[key];
3287
+ if (def && def.flatten) def.flatten(key, obj, flat);
3288
+ else if (/@.*:registry$/i.test(key) || /^\/\//.test(key)) flat[key] = val;
3289
+ }
3290
+ return flat;
3291
+ };
3292
+ const definitionProps = Object.entries(definitions).reduce((acc, [key, { short = [], default: d }]) => {
3293
+ for (const s of [].concat(short)) acc.shorthands[s] = [`--${key}`];
3294
+ acc.defaults[key] = d;
3295
+ return acc;
3296
+ }, {
3297
+ shorthands: {},
3298
+ defaults: {}
3299
+ });
3300
+ const shorthands = {
3301
+ "enjoy-by": ["--before"],
3302
+ d: ["--loglevel", "info"],
3303
+ dd: ["--loglevel", "verbose"],
3304
+ ddd: ["--loglevel", "silly"],
3305
+ quiet: ["--loglevel", "warn"],
3306
+ q: ["--loglevel", "warn"],
3307
+ s: ["--loglevel", "silent"],
3308
+ silent: ["--loglevel", "silent"],
3309
+ verbose: ["--loglevel", "verbose"],
3310
+ desc: ["--description"],
3311
+ help: ["--usage"],
3312
+ local: ["--no-global"],
3313
+ n: ["--no-yes"],
3314
+ no: ["--no-yes"],
3315
+ porcelain: ["--parseable"],
3316
+ readonly: ["--read-only"],
3317
+ reg: ["--registry"],
3318
+ iwr: ["--include-workspace-root"],
3319
+ ws: ["--workspaces"],
3320
+ ...definitionProps.shorthands
3321
+ };
3322
+ module.exports = {
3323
+ defaults: definitionProps.defaults,
3324
+ definitions,
3325
+ flatten,
3326
+ nerfDarts: [
3327
+ "_auth",
3328
+ "_authToken",
3329
+ "_password",
3330
+ "certfile",
3331
+ "email",
3332
+ "keyfile",
3333
+ "username"
3334
+ ],
3335
+ proxyEnv: [
3336
+ "http_proxy",
3337
+ "https_proxy",
3338
+ "proxy",
3339
+ "no_proxy"
3340
+ ],
3341
+ shorthands
3342
+ };
3343
+ }));
3344
+ //#endregion
3345
+ export default require_definitions();
3346
+ export {};
3347
+
3348
+ //# sourceMappingURL=definitions-ClJIBYEm.mjs.map