Check if there is an update.
npm install --save check-update
var checkUpdate = require('check-update');
var pkg = require('./package.json');
checkUpdate({packageName: pkg.name, packageVersion: pkg.version, isCLI: true}, function(err, latestVersion, defaultMessage){
if(!err){
console.log(defaultMessage);
}
});
Required
Type: string
Define the package name for search in NPM.
Required if you want a default message
Type: string
Define the version currently installed.
Type: boolean
Default: false
Define if your package is a cli.