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.
Copy file name to clipboardExpand all lines: README.md
+24-6Lines changed: 24 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,11 @@ Simple **version checker** working with **GitHub releases** and the **GitHub API
3
3
4
4
## Install
5
5
```bash
6
-
npm install --save github-version-checker
6
+
$ npm install github-version-checker
7
+
```
8
+
or
9
+
```bash
10
+
$ yarn install github-version-checker
7
11
```
8
12
9
13
## Usage
@@ -18,7 +22,8 @@ const options = {
18
22
currentVersion:pkg.version, // your app's current version
19
23
includePreReleases:false// if you want to check pre-releases to
20
24
};
21
-
versionCheck(options, function (update) { // callback function
25
+
versionCheck(options, function (update, error) { // callback function
26
+
if (error) throw error;
22
27
if (update) { // print some update info if an update is available
23
28
console.log('An update is available!');
24
29
console.log('New version: '+update.tag_name);
@@ -35,16 +40,29 @@ Check the [examples folder](https://github.com/axelrindle/github-version-checker
35
40
### Note on semantic versioning
36
41
Always try to follow a clear [semver format](http://semver.org/). This helps to avoid parsing mistakes and getting a clear result.
37
42
38
-
## Options
43
+
## API
44
+
### `function versionCheck(options, [callback])`
45
+
Performs an update check with the given options. The `callback` is optional, can be left out to return a `Promise`.
46
+
47
+
#### The `options` object
39
48
Option | Default value | Description
40
49
--- | --- | ---
41
50
repo | **None. Required option** | Defines from which GitHub repository to load releases from.
42
51
currentVersion | **None. Required option** | Your app's current version. Needed to check if a newer release is found.
43
52
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.
44
53
45
-
## The `update` object
46
-
The object you receive in the callback function, follows the format specified here:
0 commit comments