Skip to content

cedced19/check-update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

check-update

Build Status NPM version

Check if there is an update.

npm install --save check-update

Example

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);
    }
});

Options

packageName

Required
Type: string

Define the package name for search in NPM.

packageVersion

Required if you want a default message
Type: string

Define the version currently installed.

isCLI

Type: boolean
Default: false

Define if your package is a cli.