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

Commit a68849f

Browse files
committed
Add typescript example
1 parent 3b943c5 commit a68849f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# TypeScript
2+
3+
```ts showLineNumbers title="src/util/version-check.ts"
4+
import versionCheck from '@github-version-checker/core'
5+
6+
const currentVersion = getAppVersion()
7+
const { update } = await versionCheck({
8+
token: 'my-token',
9+
repo: 'github-version-checker',
10+
owner: 'axelrindle',
11+
currentVersion,
12+
})
13+
14+
if (update) {
15+
console.log('An update is available! ' + update.name)
16+
console.log('You are on version ' + currentVersion + '!')
17+
} else {
18+
console.log('You are up to date.')
19+
}
20+
```

0 commit comments

Comments
 (0)