# @systemsoftware/versionchecker

> Keep your apps up-to-date with GitHub

Latest version **0.0.2** (published 2023-07-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @systemsoftware/versionchecker
pnpm add @systemsoftware/versionchecker
yarn add @systemsoftware/versionchecker
bun add @systemsoftware/versionchecker
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2023-07-27 |
| First published | 2023-04-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | systemsoftware |
| Maintainers | systemsoftware |

## Links

- npm: https://www.npmjs.com/package/@systemsoftware/versionchecker
- Repository: https://github.com/systemsoftware/versionchecker
- Homepage: https://github.com/systemsoftware/versionchecker#readme
- Issues: https://github.com/systemsoftware/versionchecker/issues
- Funding: https://www.patreon.com/coolstone
- npm.io page: https://npm.io/package/@systemsoftware/versionchecker

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^1.4.0
- [semver](https://npm.io/package/semver.md) ^7.5.4

## Recent versions

- 0.0.2 (latest) — 2023-07-27
- 0.0.1 — 2023-04-02

## README

# VersionChecker
### Keep your apps up-to-date!

## Installation
[`npm i @systemsoftware/versionchecker`](https://docs.npmjs.com/getting-started/installing-npm-packages-locally)

# Setup
## 1. Create a Repo on Github
[Create a Repo](https://github.com/new)
## 2. Create file
Create a file called `versions.json` in the root of your repo

## 3. Add versions
### For a single app

```json
{
    "version": "1.0.0",
    "download": "",
    "changelog": ""
}
```

### For multiple apps
If you want to have multiple apps in one file, add them like this:
 ```json
{
    "com.yourcompany.yourapp": {
     "version": "1.0.0",
     "download": "",
     "changelog": ""
 },
    "com.yourcompany.yourapp2": {
     "version": "1.2.0",
     "download": "",
     "changelog": ""
 }
 }
```

## 4. Set up your index.js file

```js
const VersionChecker = require('@systemsoftware/versionchecker');

const checker = new VersionChecker('repo-owner/repo-name', 'CURRENT VERSION HERE', {
    key:"version", // The key of the version in your json file. If you have multiple, set this to `com.yourcompany.yourapp`
    filename: 'versions.json', // The name of your json file
    branch: 'master', // The branch your json file is on
    // v_key: 'version' // Acts as "key" if "key" is an object, usually used for multiple apps
}); // The options are optional

(async () => {
console.log(await checker.check()); // { ok: true, latest: 'LATEST VERSION HERE' }
})();
```


### Default Option Values
> *Other arguments are required*
* key: 'version'
* filename: 'index.json'
* branch: 'master'
* v_key: 'version' (only for multiple apps)

## 5. Run your app

### Responses
#### Not Up-to-Date
```json
{
  "ok": false,
  "error": null,
  "changelog": "Example Changelog",
  "download": "http://example.com/download",
  "latest": "2.0.0"
}
```
#### Up-to-Date
```json
{
  "ok": true,
  "error": null,
  "changelog": null,
  "download": null,
  "latest": "2.0.0"
}
```
#### Error
```js
{
  "ok": false,
  "error":"error", // Will be a JS error
}
```

# Other info
 Get more in-depth help or suggest something on [Discord](https://discord.gg/nzTmfZ8) & [Github](https://github.com/systemsoftware/versionchecker/issues)

 Like our work? [Support us on Patreon](https://www.patreon.com/coolstone)

---
_Source: https://npm.io/package/@systemsoftware/versionchecker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
