You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 19, 2025. It is now read-only.
constpkg=require('./package.json'); // or whereever your package.json lies
15
14
16
-
// version check options
15
+
// version check options (for details see below)
17
16
constoptions= {
18
17
repo:'axelrindle/github-version-checker', // will be expanded to https://api.github.com/repos/axelrindle/github-version-checker/releases
19
-
currentVersion:pkg.version
18
+
currentVersion:pkg.version, // your app's current version
19
+
includePreReleases:false// if you want to check pre-releases to
20
20
};
21
21
versionCheck(options, function (update) { // callback function
22
22
if (update) { // print some update info if an update is available
@@ -30,28 +30,17 @@ versionCheck(options, function (update) { // callback function
30
30
//...
31
31
});
32
32
```
33
+
Check the [examples folder](https://github.com/axelrindle/github-version-checker/tree/master/examples) for more examples.
33
34
34
-
### CoffeeScript
35
-
```coffeescript
36
-
# require modules
37
-
versionCheck=require('github-version-checker')
38
-
pkg=require('./package.json') # or whereever your package.json lies
35
+
### Note on semantic versioning
36
+
Always try to follow a clear [semver format](http://semver.org/). This helps to avoid parsing mistakes and getting a clear result.
39
37
40
-
# version check options
41
-
options=
42
-
repo:'axelrindle/github-version-checker'
43
-
currentVersion:pkg.version
44
-
45
-
versionCheck options, (update) -># callback function
46
-
if update # print some update info if an update is available
47
-
console.log'An update is available!'
48
-
console.log'New version: '+update.tag_name
49
-
console.log'Details here: '+update.html_url
50
-
51
-
# start your app
52
-
console.log'Starting app...'
53
-
#...
54
-
```
38
+
## Options
39
+
Option | Default value | Description
40
+
--- | --- | ---
41
+
repo | **None. Required option** | Defines from which GitHub repository to load releases from.
42
+
currentVersion | **None. Required option** | Your app's current version. Needed to check if a newer release is found.
43
+
includePreReleases | false | Whether or not to include pre-releases. **Note:** This will fetch **all** releases, which might result in high traffic, depending on how much releases your app has on GitHub.
55
44
56
45
## The `update` object
57
46
The object you receive in the callback function, follows the format specified here:
0 commit comments