Skip to content

Instantly share code, notes, and snippets.

@riston
Created October 22, 2015 11:27
Show Gist options
  • Save riston/cb21221ea8128679e9aa to your computer and use it in GitHub Desktop.
Save riston/cb21221ea8128679e9aa to your computer and use it in GitHub Desktop.
Check if there are any packages which need upgrade
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