Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scrwdrv/startup-update-check
Check your custom CLI tool version with npm at startup and notify users if a newer version is published.
https://github.com/scrwdrv/startup-update-check
cli custom-cli notify-users npm startup update version-check
Last synced: about 1 month ago
JSON representation
Check your custom CLI tool version with npm at startup and notify users if a newer version is published.
- Host: GitHub
- URL: https://github.com/scrwdrv/startup-update-check
- Owner: scrwdrv
- License: mit
- Created: 2020-01-21T03:48:03.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-28T23:11:18.000Z (over 1 year ago)
- Last Synced: 2024-11-14T12:06:45.804Z (2 months ago)
- Topics: cli, custom-cli, notify-users, npm, startup, update, version-check
- Language: TypeScript
- Size: 7.81 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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);
});
```