Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Commit 0034795

Browse files
author
Axel Rindle
committed
Updated README
1 parent 264bf9a commit 0034795

1 file changed

Lines changed: 12 additions & 24 deletions

File tree

README.md

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ npm install --save github-version-checker
77
```
88

99
## Usage
10-
### JavaScript
1110
```javascript
1211
// require modules
1312
const versionCheck = require('github-version-checker');
1413
const pkg = require('./package.json'); // or whereever your package.json lies
1514

16-
// version check options
15+
// version check options (for details see below)
1716
const options = {
1817
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
2020
};
2121
versionCheck(options, function (update) { // callback function
2222
if (update) { // print some update info if an update is available
@@ -31,27 +31,15 @@ versionCheck(options, function (update) { // callback function
3131
});
3232
```
3333

34-
### CoffeeScript
35-
```coffeescript
36-
# require modules
37-
versionCheck = require('github-version-checker')
38-
pkg = require('./package.json') # or whereever your package.json lies
34+
### Note on semantic versioning
35+
Always try to follow a clear [semver format](http://semver.org/). This helps to avoid parsing mistakes and getting a clear result.
3936

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-
```
37+
## Options
38+
Option | Default value | Description
39+
--- | --- | ---
40+
repo | **None. Required option** | Defines from which GitHub repository to load releases from.
41+
currentVersion | **None. Required option** | Your app's current version. Needed to check if a newer release is found.
42+
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.
5543

5644
## The `update` object
5745
The object you receive in the callback function, follows the format specified here:
@@ -61,4 +49,4 @@ https://developer.github.com/v3/repos/releases/#get-a-single-release
6149

6250
* Add a sync method returning just `true` or `false`
6351
* Add settings to define an own update service
64-
* Only compare to the latest release on GitHub (see [#1](https://github.com/axelrindle/github-version-checker/issues/1))
52+
* ~~Only compare to the latest release on GitHub (see [#1](https://github.com/axelrindle/github-version-checker/issues/1))~~

0 commit comments

Comments
 (0)