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

Commit 645cf85

Browse files
author
Axel Rindle
committed
Move documentation to the wiki
1 parent 5397d6d commit 645cf85

File tree

1 file changed

+3
-81
lines changed

1 file changed

+3
-81
lines changed

README.md

Lines changed: 3 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,16 @@
11
# github-version-checker
22
> Simple **version checker** working with **GitHub releases** and the **GitHub API**.
33
4-
# Note on upgrading to **v2.0.0**
4+
## Note on upgrading to **v2.0.0**
55
If you are upgrading from a version before **v2.0.0**, please read [**this guide**](MIGRATING-TO-2.0.0.md).
66

77
## Install
88
```bash
99
$ npm install github-version-checker
1010
```
1111

12-
## Usage
13-
```javascript
14-
// require modules
15-
const versionCheck = require('github-version-checker');
16-
const pkg = require('./package.json'); // or whereever your package.json lies
17-
18-
// version check options (for details see below)
19-
const options = {
20-
token: 'PUT-YOUR-TOKEN-HERE', // personal access token
21-
repo: 'github-version-checker', // repository name
22-
owner: 'axelrindle', // repository owner
23-
currentVersion: pkg.version, // your app's current version
24-
fetchTags: false // whether to fetch releases or tags
25-
};
26-
versionCheck(options, function (error, update) { // callback function
27-
if (error) throw error;
28-
if (update) { // print some update info if an update is available
29-
console.log('An update is available! ' + update.name);
30-
}
31-
32-
// start your app
33-
console.log('Starting app...');
34-
//...
35-
});
36-
```
37-
Check the [examples folder](https://github.com/axelrindle/github-version-checker/tree/master/examples) for more examples.
38-
39-
### Note on semantic versioning
40-
Always try to follow a clear [semver format](http://semver.org/). This helps to avoid parsing mistakes and getting a clear result. Also read [here](https://github.com/npm/node-semver#versions).
41-
42-
## API
43-
### `function versionCheck(options, [callback])`
44-
Performs an update check with the given options. The `callback` is optional, can be left out to return a `Promise`.
45-
46-
#### The `options` object
47-
Option | Description | Default Value
48-
--- | --- | ---
49-
token | A [personal access token](https://blog.github.com/2013-05-16-personal-api-tokens/) used to access the Github GraphQL API (as of version **2.0.0**).
50-
repo | The name of your Github repository.
51-
owner | The owner of your Github repository (usually your username).
52-
currentVersion | Your app's current version. Needed to check if a newer release is found.
53-
fetchTags | Whether to fetch the repositorie's git tags instead of the GitHub releases (this is useful when the releases are autogenerated from the tags). | `false`
54-
55-
#### The `callback` function (optional)
56-
Should be of the following form:
57-
```javascript
58-
function(error, update) {
59-
// ...your code
60-
}
61-
```
62-
* `error`:
63-
* If an error occurs, this holds the error message. `null` if no error occurs.
64-
* `update`:
65-
* An object in the format specified below. `null` if no update was found.
66-
67-
#### Using `Promise`
68-
You can omit the `callback` function to return a `Promise`, which resolved with the `update` object.
69-
70-
### Object schemes
71-
#### Releases
72-
When fetching releases, an object with the following structure will be returned:
73-
```js
74-
Object {
75-
name
76-
tag {
77-
name
78-
}
79-
isPrerelease
80-
publishedAt
81-
url
82-
}
83-
```
84-
85-
#### Tags
86-
When fetching tags, you will receive an object with the following structure:
87-
```js
88-
Object {
89-
name
90-
}
91-
```
12+
## Documentation
13+
[Check the Wiki](https://github.com/axelrindle/github-version-checker/wiki)
9214

9315
## License
9416
[MIT](LICENSE)

0 commit comments

Comments
 (0)