1 /* eslint-disable unicorn/no-process-exit */
3 let updateNotifier = require('.');
5 const options = JSON.parse(process.argv[2]);
7 updateNotifier = new updateNotifier.UpdateNotifier(options);
9 updateNotifier.checkNpm().then(update => {
10 // Only update the last update check time on success
11 updateNotifier.config.set('lastUpdateCheck', Date.now());
13 if (update.type && update.type !== 'latest') {
14 updateNotifier.config.set('update', update);
17 // Call process exit explicitly to terminate the child process
18 // Otherwise the child process will run forever, according to the Node.js docs