@modernpoacher/deps 2.3.6 → 2.4.0

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.
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
  }
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.6",
3
+ "version": "2.4.0",
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",
@@ -41,7 +41,7 @@ export const formatDirectory = PLATFORM === 'win32'
41
41
  ? (directory) => resolve(normalize(directory.trim()))
42
42
  : (directory) => {
43
43
  const d = directory.trim()
44
- if (d.startsWith(HOME)) return resolve(normalize(d.replace(new RegExp('^' + HOME), '~')))
44
+ if (d.startsWith(HOME)) return resolve(normalize(d)).replace(new RegExp('^' + HOME), '~')
45
45
  return d
46
46
  }
47
47
 
@@ -111,7 +111,7 @@ export function use (key) {
111
111
  const s = v.trim()
112
112
  if (s) {
113
113
  if (s.startsWith(HOME)) {
114
- log(resolve(normalize(s.replace(new RegExp('^' + HOME), '~'))))
114
+ log(resolve(normalize(s)).replace(new RegExp('^' + HOME), '~'))
115
115
  } else {
116
116
  log(v.trimEnd())
117
117
  }
@@ -135,7 +135,7 @@ export function out (key, directory) {
135
135
  const s = v.trim()
136
136
  if (s) {
137
137
  if (s.startsWith(HOME)) {
138
- log(resolve(normalize(s.replace(new RegExp('^' + HOME), '~'))))
138
+ log(resolve(normalize(s)).replace(new RegExp('^' + HOME), '~'))
139
139
  } else {
140
140
  log(v.trimEnd())
141
141
  }
@@ -183,7 +183,7 @@ export function err (key, directory) {
183
183
  const s = v.trim()
184
184
  if (s) {
185
185
  if (s.startsWith(HOME)) {
186
- log(resolve(normalize(s.replace(new RegExp('^' + HOME), '~'))))
186
+ log(resolve(normalize(s)).replace(new RegExp('^' + HOME), '~'))
187
187
  } else {
188
188
  log(v.trimEnd())
189
189
  }
@@ -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
  }