Check your custom CLI tool version with npm at startup and notify users if a newer version is published.
npm i startup-update-check
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);
});
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);
});