@modernpoacher/deps 2.3.7 → 2.4.1

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.
@@ -63,9 +63,11 @@ import {
63
63
  REGISTRY,
64
64
  AUTHOR,
65
65
  getRegistryParameter,
66
+ getUserConfigParameter,
66
67
  getForceParameter,
67
68
  getNvm,
68
- getBin
69
+ getBin,
70
+ USERCONFIG
69
71
  } from '#deps/src/common'
70
72
 
71
73
  const log = debug('@modernpoacher/deps')
@@ -91,12 +93,12 @@ rm -rf node_modules package-lock.json
91
93
  `))
92
94
 
93
95
  const getNpmiCommands = PLATFORM === 'win32'
94
- ? (registry = REGISTRY, force = false) => trim(tidy(getRegistryParameter(registry, getForceParameter(force, 'npm i'))))
95
- : (registry = REGISTRY, force = false) => trim(tidy(getBin(getNvm(getRegistryParameter(registry, getForceParameter(force, 'npm i'))))))
96
+ ? (registry = REGISTRY, userconfig = USERCONFIG, force = false) => trim(tidy(getRegistryParameter(registry, getUserConfigParameter(userconfig, getForceParameter(force, 'npm i')))))
97
+ : (registry = REGISTRY, userconfig = USERCONFIG, force = false) => trim(tidy(getBin(getNvm(getRegistryParameter(registry, getUserConfigParameter(userconfig, getForceParameter(force, 'npm i')))))))
96
98
 
97
99
  const getDepsCommands = PLATFORM === 'win32'
98
- ? (registry = REGISTRY, force = false) => trim(tidy(getRegistryParameter(registry, getForceParameter(force, 'deps'))))
99
- : (registry = REGISTRY, force = false) => trim(tidy(getBin(getNvm(getRegistryParameter(registry, getForceParameter(force, 'deps'))))))
100
+ ? (registry = REGISTRY, userconfig = USERCONFIG, force = false) => trim(tidy(getRegistryParameter(registry, getUserConfigParameter(userconfig, getForceParameter(force, 'deps')))))
101
+ : (registry = REGISTRY, userconfig = USERCONFIG, force = false) => trim(tidy(getBin(getNvm(getRegistryParameter(registry, getUserConfigParameter(userconfig, getForceParameter(force, 'deps')))))))
100
102
 
101
103
  export const DEPS = PLATFORM === 'win32'
102
104
  ? `bash "${join(BIN, '.\\bash\\deps.sh')}"`
@@ -395,17 +397,18 @@ function rmrf (d = DIRECTORY) {
395
397
  /**
396
398
  * @param {string} [d]
397
399
  * @param {string} [registry]
400
+ * @param {string} [userconfig]
398
401
  * @param {boolean} [force]
399
402
  * @returns {Promise<string>}
400
403
  */
401
- function npmi (d = DIRECTORY, registry = REGISTRY, force = false) {
404
+ function npmi (d = DIRECTORY, registry = REGISTRY, userconfig = USERCONFIG, force = false) {
402
405
  log('npmi')
403
406
 
404
407
  const directory = normalize(d.trim())
405
408
 
406
409
  return (
407
410
  new Promise((resolve, reject) => {
408
- const commands = getNpmiCommands(registry, force)
411
+ const commands = getNpmiCommands(registry, userconfig, force)
409
412
  const options = getOptions(directory)
410
413
  /**
411
414
  * @type {HandleComplete}
@@ -436,17 +439,18 @@ function npmi (d = DIRECTORY, registry = REGISTRY, force = false) {
436
439
  /**
437
440
  * @param {string} [d]
438
441
  * @param {string} [registry]
442
+ * @param {string} [userconfig]
439
443
  * @param {boolean} [force]
440
444
  * @returns {Promise<string>}
441
445
  */
442
- function deps (d = DIRECTORY, registry = REGISTRY, force = false) {
446
+ function deps (d = DIRECTORY, registry = REGISTRY, userconfig = USERCONFIG, force = false) {
443
447
  log('deps')
444
448
 
445
449
  const directory = normalize(d.trim())
446
450
 
447
451
  return (
448
452
  new Promise((resolve, reject) => {
449
- const commands = getDepsCommands(registry, force)
453
+ const commands = getDepsCommands(registry, userconfig, force)
450
454
  const options = getOptions(directory)
451
455
  /**
452
456
  * @type {HandleComplete}
package/bin/deps.mjs CHANGED
@@ -64,6 +64,7 @@ async function app () {
64
64
  .option('-O, --save-optional [optionalDependencies]', 'Install `optionalDependencies`', false)
65
65
  .option('-B, --save-bundle [bundleDependencies]', 'Install `bundleDependencies`', false)
66
66
  .option('--registry [registry]', 'Installation registry')
67
+ .option('--userconfig [userconfig]', 'User config')
67
68
  .option('--force [force]', 'Force installation`', false)
68
69
  .parse(argv)
69
70
 
@@ -79,8 +80,9 @@ async function app () {
79
80
  saveDev: D,
80
81
  saveOptional: O,
81
82
  saveBundle: B,
82
- force,
83
- registry
83
+ registry,
84
+ userconfig,
85
+ force
84
86
  } = commander.opts()
85
87
 
86
88
  table({
@@ -89,6 +91,7 @@ async function app () {
89
91
  saveOptional: O,
90
92
  saveBundle: B,
91
93
  ...(registry ? { registry } : {}),
94
+ ...(userconfig ? { userconfig } : {}),
92
95
  ...(force ? { force } : {})
93
96
  })
94
97
 
@@ -115,7 +118,7 @@ async function app () {
115
118
  log('Prod')
116
119
 
117
120
  try {
118
- await executeProd(DEPS_PATH, getProdDependencies(PACKAGE), getProdDependencies(CONFIGURATION), registry, force)
121
+ await executeProd(DEPS_PATH, getProdDependencies(PACKAGE), getProdDependencies(CONFIGURATION), registry, userconfig, force)
119
122
  } catch (e) {
120
123
  if (e instanceof Error) handleError(e)
121
124
  }
@@ -123,7 +126,7 @@ async function app () {
123
126
  log('Dev')
124
127
 
125
128
  try {
126
- await executeDev(DEPS_PATH, getDevDependencies(PACKAGE), getDevDependencies(CONFIGURATION), registry, force)
129
+ await executeDev(DEPS_PATH, getDevDependencies(PACKAGE), getDevDependencies(CONFIGURATION), registry, userconfig, force)
127
130
  } catch (e) {
128
131
  if (e instanceof Error) handleError(e)
129
132
  }
@@ -132,7 +135,7 @@ async function app () {
132
135
  log('Prod')
133
136
 
134
137
  try {
135
- await executeProd(DEPS_PATH, getProdDependencies(PACKAGE), getProdDependencies(CONFIGURATION), registry, force)
138
+ await executeProd(DEPS_PATH, getProdDependencies(PACKAGE), getProdDependencies(CONFIGURATION), registry, userconfig, force)
136
139
  } catch (e) {
137
140
  if (e instanceof Error) handleError(e)
138
141
  }
@@ -141,7 +144,7 @@ async function app () {
141
144
  log('Dev')
142
145
 
143
146
  try {
144
- await executeDev(DEPS_PATH, getDevDependencies(PACKAGE), getDevDependencies(CONFIGURATION), registry, force)
147
+ await executeDev(DEPS_PATH, getDevDependencies(PACKAGE), getDevDependencies(CONFIGURATION), registry, userconfig, force)
145
148
  } catch (e) {
146
149
  if (e instanceof Error) handleError(e)
147
150
  }
@@ -150,7 +153,7 @@ async function app () {
150
153
  log('Optional')
151
154
 
152
155
  try {
153
- await executeOptional(DEPS_PATH, getOptionalDependencies(PACKAGE), getOptionalDependencies(CONFIGURATION), registry, force)
156
+ await executeOptional(DEPS_PATH, getOptionalDependencies(PACKAGE), getOptionalDependencies(CONFIGURATION), registry, userconfig, force)
154
157
  } catch (e) {
155
158
  if (e instanceof Error) handleError(e)
156
159
  }
@@ -159,7 +162,7 @@ async function app () {
159
162
  log('Bundle')
160
163
 
161
164
  try {
162
- await executeBundle(DEPS_PATH, getBundleDependencies(PACKAGE), getBundleDependencies(CONFIGURATION), registry, force)
165
+ await executeBundle(DEPS_PATH, getBundleDependencies(PACKAGE), getBundleDependencies(CONFIGURATION), registry, userconfig, force)
163
166
  } catch (e) {
164
167
  if (e instanceof Error) handleError(e)
165
168
  }
@@ -47,6 +47,7 @@ import {
47
47
  import {
48
48
  DIRECTORY,
49
49
  REGISTRY,
50
+ USERCONFIG,
50
51
  getIgnore,
51
52
  getAuthor,
52
53
  getMessage
@@ -283,12 +284,13 @@ async function * genDirectory (directory) {
283
284
  /**
284
285
  * @param {string} directory
285
286
  * @param {string} registry
287
+ * @param {string} userconfig
286
288
  * @param {boolean} force
287
289
  * @param {string} message
288
290
  * @param {string | { name: string; email: string }} author
289
291
  * @returns {Promise<void>}
290
292
  */
291
- async function iterate (directory, registry, force, message, author) {
293
+ async function iterate (directory, registry, userconfig, force, message, author) {
292
294
  log('iterate')
293
295
 
294
296
  if (directory) {
@@ -302,7 +304,7 @@ async function iterate (directory, registry, force, message, author) {
302
304
  const ignore = await getIgnoreFromConfiguration(D)
303
305
 
304
306
  if (!ignore) {
305
- await execute(D, registry, force, await toMessage(message, D), await toAuthor(author, D))
307
+ await execute(D, registry, userconfig, force, await toMessage(message, D), await toAuthor(author, D))
306
308
  }
307
309
  }
308
310
  }
@@ -315,36 +317,39 @@ async function iterate (directory, registry, force, message, author) {
315
317
  /**
316
318
  * @param {string} directory
317
319
  * @param {string} registry
320
+ * @param {string} userconfig
318
321
  * @param {boolean} force
319
322
  * @param {string} message
320
323
  * @param {string | { name: string; email: string }} author
321
324
  * @returns {Promise<void>}
322
325
  */
323
- async function iteratePath (directory, registry, force, message, author) {
326
+ async function iteratePath (directory, registry, userconfig, force, message, author) {
324
327
  log('iteratePath')
325
328
 
326
329
  if (directory) {
327
330
  const D = resolve(directory)
328
331
 
329
- for await (const d of genDirectory(D)) await iterate(d, registry, force, message, author)
332
+ for await (const d of genDirectory(D)) await iterate(d, registry, userconfig, force, message, author)
330
333
  }
331
334
  }
332
335
 
333
336
  /**
334
337
  * @param {string} directory
335
338
  * @param {string} registry
339
+ * @param {string} userconfig
336
340
  * @param {boolean} force
337
341
  * @param {string} message
338
342
  * @param {string | { name: string; email: string }} author
339
343
  * @returns {Promise<void>}
340
344
  */
341
- async function execute (directory = DIRECTORY, registry = REGISTRY, force = false, message = MESSAGE, author = AUTHOR) {
345
+ async function execute (directory = DIRECTORY, registry = REGISTRY, userconfig = USERCONFIG, force = false, message = MESSAGE, author = AUTHOR) {
342
346
  log('execute')
343
347
 
344
348
  try {
345
349
  table({
346
350
  directory: formatDirectory(directory),
347
351
  registry,
352
+ userconfig,
348
353
  force,
349
354
  message
350
355
  })
@@ -353,8 +358,8 @@ async function execute (directory = DIRECTORY, registry = REGISTRY, force = fals
353
358
 
354
359
  await gitPull(directory)
355
360
  await rmrf(directory)
356
- await npmi(directory, registry, force)
357
- await deps(directory, registry, force)
361
+ await npmi(directory, registry, userconfig, force)
362
+ await deps(directory, registry, userconfig, force)
358
363
  await gitAdd(directory)
359
364
  await gitCommit(directory, message, author)
360
365
  await gitPush(directory)
@@ -367,12 +372,13 @@ async function execute (directory = DIRECTORY, registry = REGISTRY, force = fals
367
372
  /**
368
373
  * @param {string} directory
369
374
  * @param {string} registry
375
+ * @param {string} userconfig
370
376
  * @param {boolean} force
371
377
  * @param {string} message
372
378
  * @param {string | { name: string; email: string }} author
373
379
  * @returns {Promise<void>}
374
380
  */
375
- async function executeFrom (directory, registry, force, message, author) {
381
+ async function executeFrom (directory, registry, userconfig, force, message, author) {
376
382
  log('executeFrom')
377
383
 
378
384
  if (directory) {
@@ -386,7 +392,7 @@ async function executeFrom (directory, registry, force, message, author) {
386
392
  const ignore = await getIgnoreFromConfiguration(D)
387
393
 
388
394
  if (!ignore) {
389
- await execute(D, registry, force, await toMessage(message, D), await toAuthor(author, D))
395
+ await execute(D, registry, userconfig, force, await toMessage(message, D), await toAuthor(author, D))
390
396
  }
391
397
  }
392
398
  }
@@ -399,12 +405,13 @@ async function executeFrom (directory, registry, force, message, author) {
399
405
  /**
400
406
  * @param {string} directory
401
407
  * @param {string} registry
408
+ * @param {string} userconfig
402
409
  * @param {boolean} force
403
410
  * @param {string} message
404
411
  * @param {string | { name: string; email: string }} author
405
412
  * @returns {Promise<void>}
406
413
  */
407
- async function executeOnly (directory, registry, force, message, author) {
414
+ async function executeOnly (directory, registry, userconfig, force, message, author) {
408
415
  log('executeOnly')
409
416
 
410
417
  if (directory) {
@@ -418,7 +425,7 @@ async function executeOnly (directory, registry, force, message, author) {
418
425
  const ignore = await getIgnoreFromConfiguration(D)
419
426
 
420
427
  if (!ignore) {
421
- await execute(D, registry, force, await toMessage(message, D), await toAuthor(author, D))
428
+ await execute(D, registry, userconfig, force, await toMessage(message, D), await toAuthor(author, D))
422
429
  }
423
430
  }
424
431
  }
@@ -431,12 +438,13 @@ async function executeOnly (directory, registry, force, message, author) {
431
438
  /**
432
439
  * @param {string} directory
433
440
  * @param {string} registry
441
+ * @param {string} userconfig
434
442
  * @param {boolean} force
435
443
  * @param {string} message
436
444
  * @param {string | { name: string; email: string }} author
437
445
  * @returns {Promise<void>}
438
446
  */
439
- async function executePath (directory, registry, force, message, author) {
447
+ async function executePath (directory, registry, userconfig, force, message, author) {
440
448
  log('executePath')
441
449
 
442
450
  if (directory) {
@@ -450,7 +458,7 @@ async function executePath (directory, registry, force, message, author) {
450
458
  const ignore = await getIgnoreFromConfiguration(D)
451
459
 
452
460
  if (!ignore) {
453
- await execute(D, registry, force, await toMessage(message, D), await toAuthor(author, D))
461
+ await execute(D, registry, userconfig, force, await toMessage(message, D), await toAuthor(author, D))
454
462
  }
455
463
  }
456
464
  }
@@ -461,7 +469,7 @@ async function executePath (directory, registry, force, message, author) {
461
469
 
462
470
  if (code === 128) {
463
471
  return (
464
- await iteratePath(directory, registry, force, message, author)
472
+ await iteratePath(directory, registry, userconfig, force, message, author)
465
473
  )
466
474
  }
467
475
 
@@ -491,6 +499,7 @@ async function app () {
491
499
  .option('-f, --from [from]', 'Update from directory')
492
500
  .option('-o, --only [only]', 'Update only directory')
493
501
  .option('--registry [registry]', 'Installation registry')
502
+ .option('--userconfig [userconfig]', 'User config')
494
503
  .option('--force [force]', 'Force installation`', false)
495
504
  .option('-m, --message [message]', 'Git commit message')
496
505
  .option('-a, --author [author]', 'Git commit author')
@@ -501,6 +510,7 @@ async function app () {
501
510
  from: F,
502
511
  only: O,
503
512
  registry,
513
+ userconfig,
504
514
  force,
505
515
  message,
506
516
  author
@@ -511,6 +521,7 @@ async function app () {
511
521
  ...(F ? { from: F } : {}),
512
522
  ...(O ? { only: O } : {}),
513
523
  ...(registry ? { registry } : {}),
524
+ ...(userconfig ? { userconfig } : {}),
514
525
  ...(force ? { force } : {}),
515
526
  ...(message ? { message } : {}),
516
527
  ...(author ? { author } : {})
@@ -520,7 +531,7 @@ async function app () {
520
531
  log('Path')
521
532
 
522
533
  try {
523
- await executePath(P, registry, force, message, author)
534
+ await executePath(P, registry, userconfig, force, message, author)
524
535
  } catch (e) {
525
536
  if (e instanceof Error) handleError(e)
526
537
  }
@@ -529,7 +540,7 @@ async function app () {
529
540
  log('From')
530
541
 
531
542
  try {
532
- await executeFrom(P, registry, force, message, author)
543
+ await executeFrom(P, registry, userconfig, force, message, author)
533
544
  } catch (e) {
534
545
  if (e instanceof Error) handleError(e)
535
546
  }
@@ -538,7 +549,7 @@ async function app () {
538
549
  log('Only')
539
550
 
540
551
  try {
541
- await executeOnly(P, registry, force, message, author)
552
+ await executeOnly(P, registry, userconfig, force, message, author)
542
553
  } catch (e) {
543
554
  if (e instanceof Error) handleError(e)
544
555
  }
@@ -80,6 +80,7 @@ async function app () {
80
80
  peer: p,
81
81
  save,
82
82
  registry,
83
+ userconfig,
83
84
  force
84
85
  } = commander.opts()
85
86
 
@@ -91,6 +92,7 @@ async function app () {
91
92
  peer: p,
92
93
  save,
93
94
  ...(registry ? { registry } : {}),
95
+ ...(userconfig ? { userconfig } : {}),
94
96
  ...(force ? { force } : {})
95
97
  })
96
98
 
@@ -117,7 +119,7 @@ async function app () {
117
119
  log('Prod')
118
120
 
119
121
  try {
120
- await execute(DEPS_PATH, getProdDependencies(PACKAGE), getProdDependencies(CONFIGURATION), save, registry, force)
122
+ await execute(DEPS_PATH, getProdDependencies(PACKAGE), getProdDependencies(CONFIGURATION), save, registry, userconfig, force)
121
123
  } catch (e) {
122
124
  if (e instanceof Error) handleError(e)
123
125
  }
@@ -126,7 +128,7 @@ async function app () {
126
128
  log('Dev')
127
129
 
128
130
  try {
129
- await execute(DEPS_PATH, getDevDependencies(PACKAGE), getDevDependencies(CONFIGURATION), save, registry, force)
131
+ await execute(DEPS_PATH, getDevDependencies(PACKAGE), getDevDependencies(CONFIGURATION), save, registry, userconfig, force)
130
132
  } catch (e) {
131
133
  if (e instanceof Error) handleError(e)
132
134
  }
@@ -135,7 +137,7 @@ async function app () {
135
137
  log('Optional')
136
138
 
137
139
  try {
138
- await execute(DEPS_PATH, getOptionalDependencies(PACKAGE), getOptionalDependencies(CONFIGURATION), save, registry, force)
140
+ await execute(DEPS_PATH, getOptionalDependencies(PACKAGE), getOptionalDependencies(CONFIGURATION), save, registry, userconfig, force)
139
141
  } catch (e) {
140
142
  if (e instanceof Error) handleError(e)
141
143
  }
@@ -144,7 +146,7 @@ async function app () {
144
146
  log('Bundle')
145
147
 
146
148
  try {
147
- await execute(DEPS_PATH, getBundleDependencies(PACKAGE), getBundleDependencies(CONFIGURATION), save, registry, force)
149
+ await execute(DEPS_PATH, getBundleDependencies(PACKAGE), getBundleDependencies(CONFIGURATION), save, registry, userconfig, force)
148
150
  } catch (e) {
149
151
  if (e instanceof Error) handleError(e)
150
152
  }
@@ -153,7 +155,7 @@ async function app () {
153
155
  log('Peer')
154
156
 
155
157
  try {
156
- await execute(DEPS_PATH, getPeerDependencies(PACKAGE), getPeerDependencies(CONFIGURATION), save, registry, force)
158
+ await execute(DEPS_PATH, getPeerDependencies(PACKAGE), getPeerDependencies(CONFIGURATION), save, registry, userconfig, force)
157
159
  } catch (e) {
158
160
  if (e instanceof Error) handleError(e)
159
161
  }
package/eslint.config.mjs CHANGED
@@ -3,7 +3,6 @@ import jsdoc from 'eslint-plugin-jsdoc'
3
3
  import merge from '@sequencemedia/eslint-merge'
4
4
  import standard from '@sequencemedia/eslint-config-standard/configs/recommended/merge'
5
5
  import typescript from '@sequencemedia/eslint-config-typescript/configs/recommended/merge'
6
- import typescriptParser from '@typescript-eslint/parser'
7
6
 
8
7
  export default [
9
8
  merge(
@@ -70,10 +69,6 @@ export default [
70
69
  'test'
71
70
  ],
72
71
  languageOptions: {
73
- parser: typescriptParser,
74
- parserOptions: {
75
- projectService: true
76
- },
77
72
  globals: {
78
73
  ...globals.node,
79
74
  DepsTypes: 'readonly',
@@ -87,10 +82,6 @@ export default [
87
82
  'test/**/*.{mts,cts}'
88
83
  ],
89
84
  languageOptions: {
90
- parser: typescriptParser,
91
- parserOptions: {
92
- projectService: true
93
- },
94
85
  globals: {
95
86
  ...globals.browser,
96
87
  DepsTypes: 'readonly',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modernpoacher/deps",
3
- "version": "2.3.7",
3
+ "version": "2.4.1",
4
4
  "description": "Update NPM package dependencies from the command line",
5
5
  "keywords": [
6
6
  "deps",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "license": "ISC",
22
22
  "engines": {
23
- "node": ">=22.11.0"
23
+ "node": ">=22.23.4"
24
24
  },
25
25
  "repository": {
26
26
  "type": "git",
@@ -54,27 +54,26 @@
54
54
  "deps-wipe": "bin/deps/wipe.sh"
55
55
  },
56
56
  "dependencies": {
57
- "@sequencemedia/write": "^0.2.46",
58
- "commander": "^15.0.0",
57
+ "@sequencemedia/write": "^0.2.81",
58
+ "commander": "^15.1.0",
59
59
  "debug": "^4.4.3",
60
- "supports-color": "^10.2.2"
60
+ "supports-color": "^11.0.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@sequencemedia/eslint-config-standard": "^0.2.107",
64
- "@sequencemedia/eslint-config-typescript": "^0.1.182",
65
- "@sequencemedia/eslint-merge": "^0.0.67",
63
+ "@sequencemedia/eslint-config-standard": "0.3.2",
64
+ "@sequencemedia/eslint-config-typescript": "0.2.3",
65
+ "@sequencemedia/eslint-merge": "^0.0.96",
66
66
  "@types/chai": "^5.2.3",
67
67
  "@types/debug": "^4.1.13",
68
68
  "@types/mocha": "^10.0.10",
69
- "@types/node": "^26.1.1",
70
- "@typescript-eslint/parser": "^8.64.0",
71
- "chai": "^6.2.2",
69
+ "@types/node": "^26.6.6",
70
+ "chai": "^6.3.0",
72
71
  "cross-env": "^10.1.0",
73
- "eslint": "9.38.0",
74
- "eslint-plugin-jsdoc": "^63.2.0",
75
- "globals": "^17.7.0",
72
+ "eslint": "10.14.0",
73
+ "eslint-plugin-jsdoc": "^65.4.5",
74
+ "globals": "^17.14.0",
76
75
  "husky": "^9.1.7",
77
- "mocha": "^11.7.6"
76
+ "mocha": "^12.0.3"
78
77
  },
79
78
  "imports": {
80
79
  "#deps/bin": "./bin/index.mjs",
@@ -22,6 +22,8 @@ export const DIRECTORY = '.'
22
22
 
23
23
  export const REGISTRY = 'https://registry.npmjs.org'
24
24
 
25
+ export const USERCONFIG = '~/.npmrc'
26
+
25
27
  export const AUTHOR = 'Modern Poacher Limited <modernpoacher@modernpoacher.com>'
26
28
 
27
29
  const log = debug('@modernpoacher/deps')
@@ -86,6 +88,18 @@ export function getRegistryParameter (r, commands) {
86
88
  return r ? commands.concat(` --registry ${r}`) : commands
87
89
  }
88
90
 
91
+ /**
92
+ * @function getUserConfigParameter
93
+ * @description
94
+ * Get the "userconfig" parameter and argument
95
+ * @param {string} u - User Config
96
+ * @param {string} commands - Current commands string
97
+ * @returns {string}
98
+ */
99
+ export function getUserConfigParameter (u, commands) {
100
+ return u ? commands.concat(` --userconfig ${u}`) : commands
101
+ }
102
+
89
103
  /**
90
104
  * @function getForceParameter
91
105
  * @description
package/src/index.mjs CHANGED
@@ -41,7 +41,9 @@ import {
41
41
  import {
42
42
  DIRECTORY,
43
43
  REGISTRY,
44
+ USERCONFIG,
44
45
  getRegistryParameter,
46
+ getUserConfigParameter,
45
47
  getForceParameter,
46
48
  getSaveExactParameter,
47
49
  getSaveBundleParameter,
@@ -66,14 +68,15 @@ log('`deps` is awake')
66
68
  * Get the `npm install --save-exact` commands as a string
67
69
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
68
70
  * @param {string} r - Registry
71
+ * @param {string} u - User Config
69
72
  * @param {boolean} f - Force
70
73
  * @returns {string}
71
74
  */
72
- export function getInstallSaveExactCommands (deps, r, f) {
75
+ export function getInstallSaveExactCommands (deps, r, u, f) {
73
76
  log('getInstallSaveExactCommands')
74
77
 
75
78
  return normalizeCommands(
76
- getRegistryParameter(r, getForceParameter(f, getSaveExactParameter(`npm i ${transform(deps)}`)))
79
+ getRegistryParameter(r, getUserConfigParameter(u, getForceParameter(f, getSaveExactParameter(`npm i ${transform(deps)}`))))
77
80
  )
78
81
  }
79
82
 
@@ -83,14 +86,15 @@ export function getInstallSaveExactCommands (deps, r, f) {
83
86
  * Get the `npm install` commands as a string
84
87
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
85
88
  * @param {string} r - Registry
89
+ * @param {string} u - User Config
86
90
  * @param {boolean} f - Force
87
91
  * @returns {string}
88
92
  */
89
- export function getInstallCommands (deps, r, f) {
93
+ export function getInstallCommands (deps, r, u, f) {
90
94
  log('getInstallCommands')
91
95
 
92
96
  return normalizeCommands(
93
- getRegistryParameter(r, getForceParameter(f, `npm i ${transform(deps)}`))
97
+ getRegistryParameter(r, getUserConfigParameter(u, getForceParameter(f, `npm i ${transform(deps)}`)))
94
98
  )
95
99
  }
96
100
 
@@ -100,14 +104,15 @@ export function getInstallCommands (deps, r, f) {
100
104
  * Get the `npm install --save-bundle --save-exact` commands as a string
101
105
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
102
106
  * @param {string} r - Registry
107
+ * @param {string} u - User Config
103
108
  * @param {boolean} f - Force
104
109
  * @returns {string}
105
110
  */
106
- export function getInstallSaveBundleSaveExactCommands (deps, r, f) {
111
+ export function getInstallSaveBundleSaveExactCommands (deps, r, u, f) {
107
112
  log('getInstallSaveBundleSaveExactCommands')
108
113
 
109
114
  return normalizeCommands(
110
- getSaveBundleParameter(getInstallSaveExactCommands(deps, r, f))
115
+ getSaveBundleParameter(getInstallSaveExactCommands(deps, r, u, f))
111
116
  )
112
117
  }
113
118
 
@@ -117,14 +122,15 @@ export function getInstallSaveBundleSaveExactCommands (deps, r, f) {
117
122
  * Get the `npm install --save-bundle` commands as a string
118
123
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
119
124
  * @param {string} r - Registry
125
+ * @param {string} u - User Config
120
126
  * @param {boolean} f - Force
121
127
  * @returns {string}
122
128
  */
123
- export function getInstallSaveBundleCommands (deps, r, f) {
129
+ export function getInstallSaveBundleCommands (deps, r, u, f) {
124
130
  log('getInstallSaveBundleCommands')
125
131
 
126
132
  return normalizeCommands(
127
- getSaveBundleParameter(getInstallCommands(deps, r, f))
133
+ getSaveBundleParameter(getInstallCommands(deps, r, u, f))
128
134
  )
129
135
  }
130
136
 
@@ -134,14 +140,15 @@ export function getInstallSaveBundleCommands (deps, r, f) {
134
140
  * Get the `npm install --save-optional --save-exact` commands as a string
135
141
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
136
142
  * @param {string} r - Registry
143
+ * @param {string} u - User Config
137
144
  * @param {boolean} f - Force
138
145
  * @returns {string}
139
146
  */
140
- export function getInstallSaveOptionalSaveExactCommands (deps, r, f) {
147
+ export function getInstallSaveOptionalSaveExactCommands (deps, r, u, f) {
141
148
  log('getInstallSaveOptionalSaveExactCommands')
142
149
 
143
150
  return normalizeCommands(
144
- getSaveOptionalParameter(getInstallSaveExactCommands(deps, r, f))
151
+ getSaveOptionalParameter(getInstallSaveExactCommands(deps, r, u, f))
145
152
  )
146
153
  }
147
154
 
@@ -151,14 +158,15 @@ export function getInstallSaveOptionalSaveExactCommands (deps, r, f) {
151
158
  * Get the `npm install --save-optional` commands as a string
152
159
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
153
160
  * @param {string} r - Registry
161
+ * @param {string} u - User Config
154
162
  * @param {boolean} f - Force
155
163
  * @returns {string}
156
164
  */
157
- export function getInstallSaveOptionalCommands (deps, r, f) {
165
+ export function getInstallSaveOptionalCommands (deps, r, u, f) {
158
166
  log('getInstallSaveOptionalCommands')
159
167
 
160
168
  return normalizeCommands(
161
- getSaveOptionalParameter(getInstallCommands(deps, r, f))
169
+ getSaveOptionalParameter(getInstallCommands(deps, r, u, f))
162
170
  )
163
171
  }
164
172
 
@@ -168,14 +176,15 @@ export function getInstallSaveOptionalCommands (deps, r, f) {
168
176
  * Get the `npm install --save-dev --save-exact` commands as a string
169
177
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
170
178
  * @param {string} r - Registry
179
+ * @param {string} u - User Config
171
180
  * @param {boolean} f - Force
172
181
  * @returns {string}
173
182
  */
174
- export function getInstallSaveDevSaveExactCommands (deps, r, f) {
183
+ export function getInstallSaveDevSaveExactCommands (deps, r, u, f) {
175
184
  log('getInstallSaveDevSaveExactCommands')
176
185
 
177
186
  return normalizeCommands(
178
- getSaveDevParameter(getInstallSaveExactCommands(deps, r, f))
187
+ getSaveDevParameter(getInstallSaveExactCommands(deps, r, u, f))
179
188
  )
180
189
  }
181
190
 
@@ -185,14 +194,15 @@ export function getInstallSaveDevSaveExactCommands (deps, r, f) {
185
194
  * Get the `npm install --save-dev` commands as a string
186
195
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
187
196
  * @param {string} r - Registry
197
+ * @param {string} u - User Config
188
198
  * @param {boolean} f - Force
189
199
  * @returns {string}
190
200
  */
191
- export function getInstallSaveDevCommands (deps, r, f) {
201
+ export function getInstallSaveDevCommands (deps, r, u, f) {
192
202
  log('getInstallSaveDevCommands')
193
203
 
194
204
  return normalizeCommands(
195
- getSaveDevParameter(getInstallCommands(deps, r, f))
205
+ getSaveDevParameter(getInstallCommands(deps, r, u, f))
196
206
  )
197
207
  }
198
208
 
@@ -202,14 +212,15 @@ export function getInstallSaveDevCommands (deps, r, f) {
202
212
  * Get the `npm install --save-prod --save-exact` commands as a string
203
213
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
204
214
  * @param {string} r - Registry
215
+ * @param {string} u - User Config
205
216
  * @param {boolean} f - Force
206
217
  * @returns {string}
207
218
  */
208
- export function getInstallSaveProdSaveExactCommands (deps, r, f) {
219
+ export function getInstallSaveProdSaveExactCommands (deps, r, u, f) {
209
220
  log('getInstallSaveProdSaveExactCommands')
210
221
 
211
222
  return normalizeCommands(
212
- getSaveProdParameter(getInstallSaveExactCommands(deps, r, f))
223
+ getSaveProdParameter(getInstallSaveExactCommands(deps, r, u, f))
213
224
  )
214
225
  }
215
226
 
@@ -219,14 +230,15 @@ export function getInstallSaveProdSaveExactCommands (deps, r, f) {
219
230
  * Get the `npm install --save-prod` commands as a string
220
231
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
221
232
  * @param {string} r - Registry
233
+ * @param {string} u - User Config
222
234
  * @param {boolean} f - Force
223
235
  * @returns {string}
224
236
  */
225
- export function getInstallSaveProdCommands (deps, r, f) {
237
+ export function getInstallSaveProdCommands (deps, r, u, f) {
226
238
  log('getInstallSaveProdCommands')
227
239
 
228
240
  return normalizeCommands(
229
- getSaveProdParameter(getInstallCommands(deps, r, f))
241
+ getSaveProdParameter(getInstallCommands(deps, r, u, f))
230
242
  )
231
243
  }
232
244
 
@@ -237,10 +249,11 @@ export function getInstallSaveProdCommands (deps, r, f) {
237
249
  * @param {string} d - Directory
238
250
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
239
251
  * @param {string} r - Registry
252
+ * @param {string} u - User Config
240
253
  * @param {boolean} f - Force
241
254
  * @returns {Promise<string>}
242
255
  */
243
- export function installSaveBundleSaveExact (d, deps, r, f) {
256
+ export function installSaveBundleSaveExact (d, deps, r, u, f) {
244
257
  log('installSaveBundleSaveExact')
245
258
 
246
259
  const directory = normalize(d.trim())
@@ -249,7 +262,7 @@ export function installSaveBundleSaveExact (d, deps, r, f) {
249
262
 
250
263
  return (
251
264
  new Promise((resolve, reject) => {
252
- const commands = getCommands(getInstallSaveBundleSaveExactCommands(deps, r, f))
265
+ const commands = getCommands(getInstallSaveBundleSaveExactCommands(deps, r, u, f))
253
266
  const options = getOptions(directory)
254
267
  /**
255
268
  * @type {HandleComplete}
@@ -284,10 +297,11 @@ export function installSaveBundleSaveExact (d, deps, r, f) {
284
297
  * @param {string} d - Directory
285
298
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
286
299
  * @param {string} r - Registry
300
+ * @param {string} u - User Config
287
301
  * @param {boolean} f - Force
288
302
  * @returns {Promise<string>}
289
303
  */
290
- export function installSaveBundle (d, deps, r, f) {
304
+ export function installSaveBundle (d, deps, r, u, f) {
291
305
  log('installSaveBundle')
292
306
 
293
307
  const directory = normalize(d.trim())
@@ -296,7 +310,7 @@ export function installSaveBundle (d, deps, r, f) {
296
310
 
297
311
  return (
298
312
  new Promise((resolve, reject) => {
299
- const commands = getCommands(getInstallSaveBundleCommands(deps, r, f))
313
+ const commands = getCommands(getInstallSaveBundleCommands(deps, r, u, f))
300
314
  const options = getOptions(directory)
301
315
  /**
302
316
  * @type {HandleComplete}
@@ -331,10 +345,11 @@ export function installSaveBundle (d, deps, r, f) {
331
345
  * @param {string} d - Directory
332
346
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
333
347
  * @param {string} r - Registry
348
+ * @param {string} u - User Config
334
349
  * @param {boolean} f - Force
335
350
  * @returns {Promise<string>}
336
351
  */
337
- export function installSaveOptionalSaveExact (d, deps, r, f) {
352
+ export function installSaveOptionalSaveExact (d, deps, r, u, f) {
338
353
  log('installSaveOptionalSaveExact')
339
354
 
340
355
  const directory = normalize(d.trim())
@@ -343,7 +358,7 @@ export function installSaveOptionalSaveExact (d, deps, r, f) {
343
358
 
344
359
  return (
345
360
  new Promise((resolve, reject) => {
346
- const commands = getCommands(getInstallSaveOptionalSaveExactCommands(deps, r, f))
361
+ const commands = getCommands(getInstallSaveOptionalSaveExactCommands(deps, r, u, f))
347
362
  const options = getOptions(directory)
348
363
  /**
349
364
  * @type {HandleComplete}
@@ -378,10 +393,11 @@ export function installSaveOptionalSaveExact (d, deps, r, f) {
378
393
  * @param {string} d - Directory
379
394
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependencies
380
395
  * @param {string} r - Registry
396
+ * @param {string} u - User Config
381
397
  * @param {boolean} f - Force
382
398
  * @returns {Promise<string>}
383
399
  */
384
- export function installSaveOptional (d, deps, r, f) {
400
+ export function installSaveOptional (d, deps, r, u, f) {
385
401
  log('installSaveOptional')
386
402
 
387
403
  const directory = normalize(d.trim())
@@ -390,7 +406,7 @@ export function installSaveOptional (d, deps, r, f) {
390
406
 
391
407
  return (
392
408
  new Promise((resolve, reject) => {
393
- const commands = getCommands(getInstallSaveOptionalCommands(deps, r, f))
409
+ const commands = getCommands(getInstallSaveOptionalCommands(deps, r, u, f))
394
410
  const options = getOptions(directory)
395
411
  /**
396
412
  * @type {HandleComplete}
@@ -425,10 +441,11 @@ export function installSaveOptional (d, deps, r, f) {
425
441
  * @param {string} d - Directory
426
442
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
427
443
  * @param {string} r - Registry
444
+ * @param {string} u - User Config
428
445
  * @param {boolean} f - Force
429
446
  * @returns {Promise<string>}
430
447
  */
431
- export function installSaveDevSaveExact (d, deps, r, f) {
448
+ export function installSaveDevSaveExact (d, deps, r, u, f) {
432
449
  log('installSaveDevSaveExact')
433
450
 
434
451
  const directory = normalize(d.trim())
@@ -437,7 +454,7 @@ export function installSaveDevSaveExact (d, deps, r, f) {
437
454
 
438
455
  return (
439
456
  new Promise((resolve, reject) => {
440
- const commands = getCommands(getInstallSaveDevSaveExactCommands(deps, r, f))
457
+ const commands = getCommands(getInstallSaveDevSaveExactCommands(deps, r, u, f))
441
458
  const options = getOptions(directory)
442
459
  /**
443
460
  * @type {HandleComplete}
@@ -472,10 +489,11 @@ export function installSaveDevSaveExact (d, deps, r, f) {
472
489
  * @param {string} d - Directory
473
490
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
474
491
  * @param {string} r - Registry
492
+ * @param {string} u - User Config
475
493
  * @param {boolean} f - Force
476
494
  * @returns {Promise<string>}
477
495
  */
478
- export function installSaveDev (d, deps, r, f) {
496
+ export function installSaveDev (d, deps, r, u, f) {
479
497
  log('installSaveDev')
480
498
 
481
499
  const directory = normalize(d.trim())
@@ -484,7 +502,7 @@ export function installSaveDev (d, deps, r, f) {
484
502
 
485
503
  return (
486
504
  new Promise((resolve, reject) => {
487
- const commands = getCommands(getInstallSaveDevCommands(deps, r, f))
505
+ const commands = getCommands(getInstallSaveDevCommands(deps, r, u, f))
488
506
  const options = getOptions(directory)
489
507
  /**
490
508
  * @type {HandleComplete}
@@ -519,10 +537,11 @@ export function installSaveDev (d, deps, r, f) {
519
537
  * @param {string} d - Directory
520
538
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
521
539
  * @param {string} r - Registry
540
+ * @param {string} u - User Config
522
541
  * @param {boolean} f - Force
523
542
  * @returns {Promise<string>}
524
543
  */
525
- export function installSaveProdSaveExact (d, deps, r, f) {
544
+ export function installSaveProdSaveExact (d, deps, r, u, f) {
526
545
  log('installSaveProdSaveExact')
527
546
 
528
547
  const directory = normalize(d.trim())
@@ -531,7 +550,7 @@ export function installSaveProdSaveExact (d, deps, r, f) {
531
550
 
532
551
  return (
533
552
  new Promise((resolve, reject) => {
534
- const commands = getCommands(getInstallSaveProdSaveExactCommands(deps, r, f))
553
+ const commands = getCommands(getInstallSaveProdSaveExactCommands(deps, r, u, f))
535
554
  const options = getOptions(directory)
536
555
  /**
537
556
  * @type {HandleComplete}
@@ -566,10 +585,11 @@ export function installSaveProdSaveExact (d, deps, r, f) {
566
585
  * @param {string} d - Directory
567
586
  * @param {DependencyDescriptor | DependencyDescriptor[]} deps - Dependency descriptor(s)
568
587
  * @param {string} r - Registry
588
+ * @param {string} u - User Config
569
589
  * @param {boolean} f - Force
570
590
  * @returns {Promise<string>}
571
591
  */
572
- export function installSaveProd (d, deps, r, f) {
592
+ export function installSaveProd (d, deps, r, u, f) {
573
593
  log('installSaveProd')
574
594
 
575
595
  const directory = normalize(d.trim())
@@ -578,7 +598,7 @@ export function installSaveProd (d, deps, r, f) {
578
598
 
579
599
  return (
580
600
  new Promise((resolve, reject) => {
581
- const commands = getCommands(getInstallSaveProdCommands(deps, r, f))
601
+ const commands = getCommands(getInstallSaveProdCommands(deps, r, u, f))
582
602
  const options = getOptions(directory)
583
603
  /**
584
604
  * @type {HandleComplete}
@@ -614,19 +634,20 @@ export function installSaveProd (d, deps, r, f) {
614
634
  * @param {Dependencies} packageDependencies - Package dependencies
615
635
  * @param {Dependencies} configurationDependencies - Configuration dependencies
616
636
  * @param {string} r - Registry
637
+ * @param {string} u - User Config
617
638
  * @param {boolean} f - Force
618
639
  * @returns {Promise<void>}
619
640
  */
620
- export async function executeBundle (d = DIRECTORY, packageDependencies = {}, configurationDependencies = {}, r = REGISTRY, f = false) {
641
+ export async function executeBundle (d = DIRECTORY, packageDependencies = {}, configurationDependencies = {}, r = REGISTRY, u = USERCONFIG, f = false) {
621
642
  log('executeBundle')
622
643
 
623
644
  const depsExact = getDepsExact(packageDependencies, configurationDependencies)
624
645
 
625
- if (depsExact.length) await installSaveBundleSaveExact(d, depsExact, r, f)
646
+ if (depsExact.length) await installSaveBundleSaveExact(d, depsExact, r, u, f)
626
647
 
627
648
  const deps = getDeps(packageDependencies)
628
649
 
629
- if (deps.length) await installSaveBundle(d, deps, r, f)
650
+ if (deps.length) await installSaveBundle(d, deps, r, u, f)
630
651
  }
631
652
 
632
653
  /**
@@ -637,19 +658,20 @@ export async function executeBundle (d = DIRECTORY, packageDependencies = {}, co
637
658
  * @param {Dependencies} packageDependencies - Package dependencies
638
659
  * @param {Dependencies} configurationDependencies - Configuration dependencies
639
660
  * @param {string} r - Registry
661
+ * @param {string} u - User Config
640
662
  * @param {boolean} f - Force
641
663
  * @returns {Promise<void>}
642
664
  */
643
- export async function executeOptional (d = DIRECTORY, packageDependencies = {}, configurationDependencies = {}, r = REGISTRY, f = false) {
665
+ export async function executeOptional (d = DIRECTORY, packageDependencies = {}, configurationDependencies = {}, r = REGISTRY, u = USERCONFIG, f = false) {
644
666
  log('executeOptional')
645
667
 
646
668
  const depsExact = getDepsExact(packageDependencies, configurationDependencies)
647
669
 
648
- if (depsExact.length) await installSaveOptionalSaveExact(d, depsExact, r, f)
670
+ if (depsExact.length) await installSaveOptionalSaveExact(d, depsExact, r, u, f)
649
671
 
650
672
  const deps = getDeps(packageDependencies)
651
673
 
652
- if (deps.length) await installSaveOptional(d, deps, r, f)
674
+ if (deps.length) await installSaveOptional(d, deps, r, u, f)
653
675
  }
654
676
 
655
677
  /**
@@ -660,19 +682,20 @@ export async function executeOptional (d = DIRECTORY, packageDependencies = {},
660
682
  * @param {Dependencies} packageDependencies - Package dependencies
661
683
  * @param {Dependencies} configurationDependencies - Configuration dependencies
662
684
  * @param {string} r - Registry
685
+ * @param {string} u - User Config
663
686
  * @param {boolean} f - Force
664
687
  * @returns {Promise<void>}
665
688
  */
666
- export async function executeDev (d = DIRECTORY, packageDependencies = {}, configurationDependencies = {}, r = REGISTRY, f = false) {
689
+ export async function executeDev (d = DIRECTORY, packageDependencies = {}, configurationDependencies = {}, r = REGISTRY, u = USERCONFIG, f = false) {
667
690
  log('executeDev')
668
691
 
669
692
  const depsExact = getDepsExact(packageDependencies, configurationDependencies)
670
693
 
671
- if (depsExact.length) await installSaveDevSaveExact(d, depsExact, r, f)
694
+ if (depsExact.length) await installSaveDevSaveExact(d, depsExact, r, u, f)
672
695
 
673
696
  const deps = getDeps(packageDependencies)
674
697
 
675
- if (deps.length) await installSaveDev(d, deps, r, f)
698
+ if (deps.length) await installSaveDev(d, deps, r, u, f)
676
699
  }
677
700
 
678
701
  /**
@@ -683,17 +706,18 @@ export async function executeDev (d = DIRECTORY, packageDependencies = {}, confi
683
706
  * @param {Dependencies} packageDependencies - Package dependencies
684
707
  * @param {Dependencies} configurationDependencies - Configuration dependencies
685
708
  * @param {string} r - Registry
709
+ * @param {string} u - User Config
686
710
  * @param {boolean} f - Force
687
711
  * @returns {Promise<void>}
688
712
  */
689
- export async function executeProd (d = DIRECTORY, packageDependencies = {}, configurationDependencies = {}, r = REGISTRY, f = false) {
713
+ export async function executeProd (d = DIRECTORY, packageDependencies = {}, configurationDependencies = {}, r = REGISTRY, u = USERCONFIG, f = false) {
690
714
  log('executeProd')
691
715
 
692
716
  const depsExact = getDepsExact(packageDependencies, configurationDependencies)
693
717
 
694
- if (depsExact.length) await installSaveProdSaveExact(d, depsExact, r, f)
718
+ if (depsExact.length) await installSaveProdSaveExact(d, depsExact, r, u, f)
695
719
 
696
720
  const deps = getDeps(packageDependencies)
697
721
 
698
- if (deps.length) await installSaveProd(d, deps, r, f)
722
+ if (deps.length) await installSaveProd(d, deps, r, u, f)
699
723
  }
@@ -33,8 +33,10 @@ import {
33
33
  import {
34
34
  DIRECTORY,
35
35
  REGISTRY,
36
+ USERCONFIG,
36
37
  getNoSaveParameter,
37
38
  getRegistryParameter,
39
+ getUserConfigParameter,
38
40
  getForceParameter,
39
41
  getSaveExactParameter,
40
42
  getCommands,
@@ -56,14 +58,15 @@ log('`install` is awake')
56
58
  * @param {DependencyDescriptor | DependencyDescriptor[]} p - Package
57
59
  * @param {boolean} s - Save
58
60
  * @param {string} r - Registry
61
+ * @param {string} u - User Config
59
62
  * @param {boolean} f - Force
60
63
  * @returns {string}
61
64
  */
62
- export function getInstallSaveExactCommands (p, s, r, f) {
65
+ export function getInstallSaveExactCommands (p, s, r, u, f) {
63
66
  log('getInstallSaveExactCommands')
64
67
 
65
68
  return normalizeCommands(
66
- getNoSaveParameter(s, getRegistryParameter(r, getForceParameter(f, getSaveExactParameter(`npm i ${transform(p)}`))))
69
+ getNoSaveParameter(s, getRegistryParameter(r, getUserConfigParameter(u, getForceParameter(f, getSaveExactParameter(`npm i ${transform(p)}`)))))
67
70
  )
68
71
  }
69
72
 
@@ -74,14 +77,15 @@ export function getInstallSaveExactCommands (p, s, r, f) {
74
77
  * @param {DependencyDescriptor | DependencyDescriptor[]} p - Package
75
78
  * @param {boolean} s - Save
76
79
  * @param {string} r - Registry
80
+ * @param {string} u - User Config
77
81
  * @param {boolean} f - Force
78
82
  * @returns {string}
79
83
  */
80
- export function getInstallCommands (p, s, r, f) {
84
+ export function getInstallCommands (p, s, r, u, f) {
81
85
  log('getInstallCommands')
82
86
 
83
87
  return normalizeCommands(
84
- getNoSaveParameter(s, getRegistryParameter(r, getForceParameter(f, `npm i ${transform(p)}`)))
88
+ getNoSaveParameter(s, getRegistryParameter(r, getUserConfigParameter(u, getForceParameter(f, `npm i ${transform(p)}`))))
85
89
  )
86
90
  }
87
91
 
@@ -93,10 +97,11 @@ export function getInstallCommands (p, s, r, f) {
93
97
  * @param {DependencyDescriptor | DependencyDescriptor[]} p - Package
94
98
  * @param {boolean} s - Save
95
99
  * @param {string} r - Registry
100
+ * @param {string} u - User Config
96
101
  * @param {boolean} f - Force
97
102
  * @returns {Promise<string>}
98
103
  */
99
- export function installSaveExact (d, p, s, r, f) {
104
+ export function installSaveExact (d, p, s, r, u, f) {
100
105
  log('installSaveExact')
101
106
 
102
107
  const directory = normalize(d.trim())
@@ -105,7 +110,7 @@ export function installSaveExact (d, p, s, r, f) {
105
110
 
106
111
  return (
107
112
  new Promise((resolve, reject) => {
108
- const commands = getCommands(getInstallSaveExactCommands(p, s, r, f))
113
+ const commands = getCommands(getInstallSaveExactCommands(p, s, r, u, f))
109
114
  const options = getOptions(directory)
110
115
  /**
111
116
  * @type {HandleComplete}
@@ -139,10 +144,11 @@ export function installSaveExact (d, p, s, r, f) {
139
144
  * @param {DependencyDescriptor | DependencyDescriptor[]} p - Package
140
145
  * @param {boolean} s - Save
141
146
  * @param {string} r - Registry
147
+ * @param {string} u - User Config
142
148
  * @param {boolean} f - Force
143
149
  * @returns {Promise<string>}
144
150
  */
145
- export function install (d, p, s, r, f) {
151
+ export function install (d, p, s, r, u, f) {
146
152
  log('install')
147
153
 
148
154
  const directory = normalize(d.trim())
@@ -151,7 +157,7 @@ export function install (d, p, s, r, f) {
151
157
 
152
158
  return (
153
159
  new Promise((resolve, reject) => {
154
- const commands = getCommands(getInstallCommands(p, s, r, f))
160
+ const commands = getCommands(getInstallCommands(p, s, r, u, f))
155
161
  const options = getOptions(directory)
156
162
  /**
157
163
  * @type {HandleComplete}
@@ -186,17 +192,18 @@ export function install (d, p, s, r, f) {
186
192
  * @param {Configuration} c - Configuration
187
193
  * @param {boolean} s - Save
188
194
  * @param {string} r - Registry
195
+ * @param {string} u - User Config
189
196
  * @param {boolean} f - Force
190
197
  * @returns {Promise<void>}
191
198
  */
192
- export async function execute (d = DIRECTORY, p = {}, c = {}, s = false, r = REGISTRY, f = false) {
199
+ export async function execute (d = DIRECTORY, p = {}, c = {}, s = false, r = REGISTRY, u = USERCONFIG, f = false) {
193
200
  log('execute')
194
201
 
195
202
  const depsExact = getDepsExact(p, c)
196
203
 
197
- if (depsExact.length) await installSaveExact(d, depsExact, s, r, f)
204
+ if (depsExact.length) await installSaveExact(d, depsExact, s, r, u, f)
198
205
 
199
206
  const deps = getDeps(p)
200
207
 
201
- if (deps.length) await install(d, deps, s, r, f)
208
+ if (deps.length) await install(d, deps, s, r, u, f)
202
209
  }