npm-check-updates
Advanced tools
Comparing version 2.0.4 to 2.1.0
@@ -90,2 +90,3 @@ var options = {}; | ||
dev: options.dev, | ||
optional: options.optional, | ||
filter: options.args[0] | ||
@@ -110,3 +111,3 @@ }); | ||
output = options.jsonAll ? JSON.parse(newPkgData) : | ||
options.jsonDeps ? _.pick(JSON.parse(newPkgData), 'dependencies', 'devDependencies') : | ||
options.jsonDeps ? _.pick(JSON.parse(newPkgData), 'dependencies', 'devDependencies', 'optionalDependencies') : | ||
upgraded; | ||
@@ -113,0 +114,0 @@ |
@@ -241,3 +241,3 @@ var async = require('async'); | ||
* Get the current dependencies from the package file | ||
* @param pkg Object with dependencies and/or devDependencies properties | ||
* @param pkg Object with dependencies, devDependencies, and/or optionalDependencies properties | ||
* @param options.filter List or regex of package names to search | ||
@@ -253,4 +253,4 @@ * @param options.prod | ||
if(!options.prod && !options.dev) { | ||
options.prod = options.dev = true; | ||
if(!options.prod && !options.dev && !options.optional) { | ||
options.prod = options.dev = options.optional = true; | ||
} | ||
@@ -260,3 +260,4 @@ | ||
options.prod && pkg.dependencies, | ||
options.dev && pkg.devDependencies | ||
options.dev && pkg.devDependencies, | ||
options.optional && pkg.optionalDependencies | ||
), packageNameFilter(options.filter)); | ||
@@ -354,7 +355,7 @@ | ||
var reason = version.reason(); | ||
if(reason.statusCode === 404) { | ||
if(reason.statusCode === 404 || reason == '404' || reason === '404 Not Found') { | ||
return null; | ||
} | ||
else { | ||
throw reason; | ||
throw new Error(reason); | ||
} | ||
@@ -361,0 +362,0 @@ } |
{ | ||
"name": "npm-check-updates", | ||
"version": "2.0.4", | ||
"version": "2.1.0", | ||
"author": "Tomas Junnonen <tomas1@gmail.com>", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -63,3 +63,2 @@ [![npm stable version](https://img.shields.io/npm/v/npm-check-updates.svg?label=stable)](https://npmjs.org/package/npm-check-updates) | ||
-d, --dev check only devDependencies | ||
-h, --help output usage information | ||
-e, --error-level set the error-level. 1: exits with error code 0 if no | ||
@@ -70,5 +69,8 @@ errors occur. 2: exits with error code 0 if no | ||
-g, --global check global packages instead of in the current project | ||
-h, --help output usage information | ||
-j, --jsonAll output new package.json instead of human-readable | ||
message | ||
--jsonUpgraded output upgraded dependencies in json | ||
--packageData include stringified package.json (use stdin instead) | ||
-o, --optional check only optionalDependencies | ||
-p, --prod check only dependencies (not devDependencies) | ||
@@ -131,39 +133,19 @@ -r, --registry specify third-party NPM registry | ||
- 2.0.1 | ||
- Fix silence | ||
- 2.1.0 | ||
- Add -o/--optional to check only optionalDependencies | ||
- 2.0.0 | ||
- Finally! Includes all the previous alpha features. :) | ||
- *2.0.0-alpha.17* | ||
- Return dependencies from programRun | ||
- Allow packageData to be specified as an option | ||
- *2.0.0-alpha.16* | ||
- minor | ||
- *2.0.0-alpha.15* | ||
- Fix wildcard bug #101. | ||
- *2.0.0-alpha.14* | ||
- Colored table output | ||
- *2.0.0-alpha.13* | ||
- Squished some bugs | ||
- *2.0.0-alpha.12* | ||
- Add -a/--upgradeAll | ||
- *2.0.0-alpha.11* | ||
- Export functionality to allow for programmatic use | ||
- *2.0.0-alpha.10* | ||
- Move filter from command-line option to argument | ||
- Add -f/--force option to force upgrades even when the latest version satisfies the declared semver dependency | ||
- *2.0.0-alpha.9* | ||
- Refactoring | ||
- *2.0.0-alpha.8* | ||
- Add ncu alias | ||
- Allow specifying third-party registry with -r/--registry flag | ||
- Replace callbacks with promises | ||
- Replace < and <= with ^ | ||
- Add -e/--error-level option | ||
- Add -j/--json and --jsonFlat flags for json output | ||
- Full unit test coverage! | ||
- *2.0.0-alpha.7* | ||
- Bug fixes and refactoring | ||
- Add -e/--error-level option | ||
- Add -r/--registry option for specifying third-party npm registry | ||
- Add -t/--greatest option to search for the highest versions instead of the default latest stable versions. | ||
- Remove -f/--filter option and move to command-line argument | ||
- Replace < and <= with ^ | ||
- Automatically look for the closest descendant package.json if not found in current directory | ||
- Do not downgrade packages | ||
- Add ncu alias | ||
- Export functionality to allow for programmatic use | ||
- Bug fixes and refactoring | ||
- Full unit test coverage! | ||
- 1.5.1 | ||
@@ -170,0 +152,0 @@ - Fix bug where package names got truncated (grunt-concurrent -> grunt) |
@@ -161,2 +161,5 @@ var vm = require("../lib/versionmanager"); | ||
lodash: '^3.9.3' | ||
}, | ||
optionalDependencies: { | ||
chalk: '^1.1.0' | ||
} | ||
@@ -172,6 +175,7 @@ }; | ||
it('should get dependencies and devDependencies by default', function () { | ||
it('should get dependencies, devDependencies, and optionalDependencies by default', function () { | ||
vm.getCurrentDependencies(deps).should.eql({ | ||
mocha: '1.2', | ||
lodash: '^3.9.3' | ||
lodash: '^3.9.3', | ||
chalk: '^1.1.0' | ||
}); | ||
@@ -192,2 +196,8 @@ }); | ||
it('should only get optionalDependencies when the optional option is true', function () { | ||
vm.getCurrentDependencies(deps, {optional: true}).should.eql({ | ||
chalk: '^1.1.0' | ||
}); | ||
}); | ||
it('should filter dependencies by package name', function () { | ||
@@ -194,0 +204,0 @@ vm.getCurrentDependencies(deps, {filter: 'mocha'}).should.eql({ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70773
1355
176