guc

github-update-checker

Checks latest project version on GitHub and compares it with current project version.

Showing:

Popularity

Downloads/wk

12

GitHub Stars

5

Maintenance

Last Commit

5yrs ago

Contributors

3

Package

Dependencies

0

Size (min+gzip)

0.9KB

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

#github-update-checker

Compares project's package.json version and latest GitHub tag version and returns the result.

It's really dumb, it just extracts all numbers from a tag name and doesn't use semver, so "v1.1.1" will become "111".

github-update-checker automatically tries to get project's package.json and construct a URL to GitHub API from repository.url section, but can get everything as an option.

##Methods

###uptodate

uptodate takes callback or options as an argument.

####Callback:

uptodate( callback(answer) )

answer

Type: Boolean or String

true (up to date), false (needs update) or 'error'.

####Options:

uptodate({
    packagePath: '/www/myproject/package.json',
    url        : 'https://api.github.com/repos/LOGIN/PROJECT/tags',
    timeout    : 10000
    callback   : callback
})

packagePath

Type: String

Absolute path to project's package.json file. github-update-checker will try to find it itself.

url

Type: String

Full URL to project's GitHub tags API. github-update-checker will try to construct it automatically from repository.url in package.json.

timeout

Type: Number

When give up waiting for GitHub API response. Default is 3000ms.

callback

Type: Function

Gets true (up to date), false (needs update) or 'error'.

Example

var updater = require( 'github-update-checker' );

updater.uptodate(function( uptodate ) {
    // uptodate is true, false or 'error'
});

Bitdeli Badge

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial