Created
October 22, 2015 11:27
-
-
Save riston/cb21221ea8128679e9aa to your computer and use it in GitHub Desktop.
Check if there are any packages which need upgrade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp.task("package-check", function () { | |
// Output the packages which needs upgrade | |
var format = function (upgraded) { | |
var packages = Object.keys(upgraded); | |
console.log("Following packages needs to be upgraded:"); | |
packages.forEach(function (packageName) | |
{ | |
var current = package.dependencies[packageName]; | |
var upgradeTo = upgraded[packageName]; | |
var line = util.format(" %s %s ⇾ %s", | |
packageName, current, upgradeTo); | |
console.log(line); | |
}) | |
return upgraded; | |
}; | |
var options = { | |
packageData: JSON.stringify(package), | |
prod: true, | |
}; | |
return ncu | |
.run(options) | |
.then(format); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment