fix: add node@10, remove node@4

This is a non-breaking change, and only shows a warning once a week:

[nodemon] WARNING: node@v4.8.7 is no longer maintained, nor supported by nodemon
More information: https://github.com/nodejs/Release#end-of-life-releases
This commit is contained in:
Remy Sharp
2018-05-05 19:31:39 +01:00
parent 66943b8419
commit fc65829480
2 changed files with 23 additions and 1 deletions

View File

@@ -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:

View File

@@ -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();