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

Commit 203faa6

Browse files
committed
Enhance examples
1 parent ee5af9a commit 203faa6

5 files changed

Lines changed: 8 additions & 5 deletions

File tree

docs/examples/01-basic/async.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The future is now! Futuristic approach leveraging top-level await.
44

5-
```js
5+
```js showLineNumbers title="src/util/version-check.js"
66
const versionCheck = require('github-version-checker')
77
const options = {
88
// token: '...',
@@ -12,6 +12,7 @@ const options = {
1212
}
1313

1414
try {
15+
// highlight-next-line
1516
const update = await versionCheck(options)
1617
if (update) { // update is null if there is no update available, so check here
1718
console.log('An update is available! ' + update.name)

docs/examples/01-basic/callback.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Using a plain old callback.
44

5-
````js
5+
````js showLineNumbers title="src/util/version-check.js"
66
const versionCheck = require('github-version-checker')
77
const options = {
88
// token: '...',

docs/examples/01-basic/promise.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Modern version using a Promise-based approach.
44

5-
```js
5+
```js showLineNumbers title="src/util/version-check.js"
66
const versionCheck = require('github-version-checker')
77
const options = {
88
// token: '...',

docs/examples/02-advanced/git-tags.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ releases api won't work.
55

66
Fetch the tags instead by setting `fetchTags` to `true`:
77

8-
```js
8+
```js showLineNumbers title="src/util/version-check.js"
99
const versionCheck = require('github-version-checker')
1010
const options = {
1111
token: 'my-token',
1212
repo: 'github-version-checker',
1313
owner: 'axelrindle',
1414
currentVersion: require('../package.json').version,
15+
// highlight-next-line
1516
fetchTags: true
1617
}
1718

docs/examples/02-advanced/rest.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ There may be scenarios where you explicitly want to call the REST API.
44

55
Set the `token` to `false` to accomplish this:
66

7-
```js
7+
```js showLineNumbers title="src/util/version-check.js"
88
const versionCheck = require('github-version-checker')
99
const options = {
10+
// highlight-next-line
1011
token: false,
1112
repo: 'github-version-checker',
1213
owner: 'axelrindle',

0 commit comments

Comments
 (0)