diff --git a/.travis.yml b/.travis.yml index a4a7dcd..a4763ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,10 @@ cache: notifications: email: false node_js: + - '10' - '9' - '8' - '6' - - '4' before_install: - if [ "$TRAVIS_PULL_REQUEST_BRANCH" == "" ]; then echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> .npmrc; fi after_success: diff --git a/lib/nodemon.js b/lib/nodemon.js index 3403cdd..72bb6eb 100644 --- a/lib/nodemon.js +++ b/lib/nodemon.js @@ -272,6 +272,28 @@ nodemon.reset = function (done) { bus.emit('reset', done); }; +bus.once('reset', () => { + // FIXME only once a week + if (utils.version.major < 6) { + const Configstore = require('configstore'); + const pkg = require(__dirname + '/../package.json'); + const now = Date.now(); + + const week = 1000 * 60 * 60 * 24 * 7; + const key = 'lastNodeWarning'; + + // create a Configstore instance with an unique ID e.g. + // Package name and optionally some default values + const conf = new Configstore(pkg.name); + const last = conf.get(key); + + if (!last || now - week > last) { + utils.log.error(`WARNING: node@${process.version} is no longer maintained, nor supported by nodemon\nMore information: https://github.com/nodejs/Release#end-of-life-releases`); + conf.set(key, now); + } + } +}); + bus.on('reset', function (done) { debug('reset'); nodemon.removeAllListeners();