tell your CLI users that their Node.js is old
Usage
Set and forget. Users will see a notification if their Node.js version needs updating.
This library will make no more than a single HTTP request every 5 days.
Simple example
const { updateNodejsNotifier } = require('update-nodejs-notifier')
updateNodejsNotifier()
Comprehensive example
const { updateNodejsNotifier } = require('update-nodejs-notifier')
updateNodejsNotifier({
// listed in order of most-severe to least-severe
// we display the first most-severe matching alert
// these are the default settings
notSupported: true, // alert if upstream Node.js support ended
daysOld: Infinity, // alert if version released this long ago
stableMajor: true, // alert if MAJOR version older than best "stable"
stableMinor: false, // alert if MINOR version older than best "stable"
stablePatch: false, // alert if PATCH version older than best "stable"
})