# startup-update-check

> Check your custom CLI tool version with npm at startup and notify users if a newer version is published.

Latest version **1.0.2** (published 2020-01-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install startup-update-check
pnpm add startup-update-check
yarn add startup-update-check
bun add startup-update-check
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-01-21 |
| First published | 2020-01-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | scrwdrv |
| Maintainers | scrwdrv |
| Keywords | cli, tool, version, npm, update, startup |

## Links

- npm: https://www.npmjs.com/package/startup-update-check
- Repository: https://github.com/scrwdrv/startup-update-check
- Homepage: https://github.com/scrwdrv/startup-update-check#readme
- Issues: https://github.com/scrwdrv/startup-update-check/issues
- npm.io page: https://npm.io/package/startup-update-check

## Dependencies (1)

- [semver](https://npm.io/package/semver.md) ^7.1.1

## Recent versions

- 1.0.2 (latest) — 2020-01-21
- 1.0.1 — 2020-01-21
- 1.0.0 — 2020-01-21

## README

# startup-update-check
Check your custom CLI tool version with npm at startup and notify users if a newer version is published.


## Installation
```sh
npm i startup-update-check
```

## Usage
### Provide path of `package.json`
```js
import checkUpdate from 'startup-update-check';

checkUpdate('./package.json').then((newerVersion) => {
    if (newerVersion) {
        //do your things
    } else if (newerVersion === null) {
        //up to date
    }
}).catch((err) => {
    console.log(err);
});
```
### Specify package name and version directly
```js
checkUpdate({
    name: 'safe-backup',
    version: '1.2.5'
}).then((newerVersion) => {
    if (newerVersion) {
        //do your things
    } else if (newerVersion === null) {
        //up to date
    }
}).catch((err) => {
    console.log(err);
});
```

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