npm-check-updates 3.2.1 → 3.2.2
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/README.md +2 -1
- package/bin/ncu +1 -1
- package/lib/npm-check-updates.js +8 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -99,7 +99,8 @@ Options
|
|
|
99
99
|
-f, --filter include only package names matching the given string,
|
|
100
100
|
comma-or-space-delimited list, or /regex/
|
|
101
101
|
-g, --global check global packages instead of in the current project
|
|
102
|
-
-i, --interactive Enable interactive prompts for each dependency
|
|
102
|
+
-i, --interactive Enable interactive prompts for each dependency;
|
|
103
|
+
Implies -u unless one of the json options are set
|
|
103
104
|
-j, --jsonAll output new package file instead of human-readable
|
|
104
105
|
message
|
|
105
106
|
--jsonDeps Will return output like `jsonAll` but only lists
|
package/bin/ncu
CHANGED
|
@@ -27,7 +27,7 @@ program
|
|
|
27
27
|
.option('-f, --filter <matches>', 'include only package names matching the given string, comma-or-space-delimited list, or /regex/')
|
|
28
28
|
.option('-g, --global', 'check global packages instead of in the current project')
|
|
29
29
|
// program.json is set to true in programInit if any options that begin with 'json' are true
|
|
30
|
-
.option('-i, --interactive', 'Enable interactive prompts for each dependency')
|
|
30
|
+
.option('-i, --interactive', 'Enable interactive prompts for each dependency; implies -u unless one of the json options are set')
|
|
31
31
|
.option('-j, --jsonAll', 'output new package file instead of human-readable message')
|
|
32
32
|
.option('--jsonDeps', 'Will return output like `jsonAll` but only lists `dependencies`, `devDependencies`, and `optionalDependencies` of the new package data.')
|
|
33
33
|
.option('--jsonUpgraded', 'output upgraded dependencies in json')
|
package/lib/npm-check-updates.js
CHANGED
|
@@ -295,6 +295,11 @@ function printUpgrades(options, {current, upgraded, numUpgraded, total}) {
|
|
|
295
295
|
/** Initializes and consolidates options from the cli. */
|
|
296
296
|
function initOptions(options) {
|
|
297
297
|
|
|
298
|
+
const json = _(options)
|
|
299
|
+
.keys()
|
|
300
|
+
.filter(_.partial(_.startsWith, _, 'json', 0))
|
|
301
|
+
.some(_.propertyOf(options));
|
|
302
|
+
|
|
298
303
|
return Object.assign({}, options, {
|
|
299
304
|
filter: options.args.join(' ') || options.filter,
|
|
300
305
|
// convert silent option to loglevel silent
|
|
@@ -303,10 +308,9 @@ function initOptions(options) {
|
|
|
303
308
|
// default to 0, except when newest or greatest are set
|
|
304
309
|
pre: options.pre ? Boolean(Number(options.pre)) : options.newest || options.greatest,
|
|
305
310
|
// add shortcut for any keys that start with 'json'
|
|
306
|
-
json
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
.some(_.propertyOf(options))
|
|
311
|
+
json,
|
|
312
|
+
// imply upgrade in interactive mode when json is not specified as the output
|
|
313
|
+
upgrade: options.interactive && options.upgrade === undefined ? !json : options.upgrade
|
|
310
314
|
});
|
|
311
315
|
}
|
|
312
316
|
|