startup-update-check
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

startup-update-check

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

Installation

npm i startup-update-check

Usage

Provide path of package.json

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

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);
});

Package Sidebar

Install

npm i startup-update-check

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

9.4 kB

Total Files

9

Last publish

Collaborators

  • scrwdrv