@@ -15,19 +15,19 @@ const pkg = require('./package.json'); // or whereever your package.json lies
1515
1616// version check options
1717const options = {
18- repo: ' axelrindle/github-version-checker' , // will be expanded to https://api.github.com/repos/axelrindle/github-version-checker/releases
19- currentVersion: pkg .version
18+ repo: ' axelrindle/github-version-checker' , // will be expanded to https://api.github.com/repos/axelrindle/github-version-checker/releases
19+ currentVersion: pkg .version
2020};
2121versionCheck (options, function (update ) { // callback function
22- if (update) { // print some update info if an update is available
23- console .log (' An update is available!' );
24- console .log (' New version: ' + update .tag_name );
25- console .log (' Details here: ' + update .html_url );
26- }
27-
28- // start your app
29- console .log (' Starting app...' );
30- // ...
22+ if (update) { // print some update info if an update is available
23+ console .log (' An update is available!' );
24+ console .log (' New version: ' + update .tag_name );
25+ console .log (' Details here: ' + update .html_url );
26+ }
27+
28+ // start your app
29+ console .log (' Starting app...' );
30+ // ...
3131});
3232```
3333
@@ -38,21 +38,21 @@ versionCheck = require('github-version-checker')
3838pkg = require (' ./package.json' ) # or whereever your package.json lies
3939
4040# version check options
41- options =
41+ options =
4242 repo : ' axelrindle/github-version-checker'
4343 currentVersion : pkg .version
44-
44+
4545versionCheck options, (update ) -> # callback function
4646 if update # print some update info if an update is available
4747 console .log ' An update is available!'
4848 console .log ' New version: ' + update .tag_name
4949 console .log ' Details here: ' + update .html_url
50-
50+
5151 # start your app
5252 console .log ' Starting app...'
5353 # ...
5454```
5555
5656## The ` update ` object
5757The object you receive in the callback function, follows the format specified here:
58- https://developer.github.com/v3/repos/releases/#get-a-single-release
58+ https://developer.github.com/v3/repos/releases/#get-a-single-release
0 commit comments