Skip to content

Commit 5b440c2

Browse files
committed
Require Node.js 10
1 parent 3dfe42d commit 5b440c2

File tree

5 files changed

+19
-18
lines changed

5 files changed

+19
-18
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: node_js
22
node_js:
3+
- '14'
34
- '12'
45
- '10'
5-
- '8'

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class UpdateNotifier {
5555
// after the set interval, so not to bother users right away
5656
lastUpdateCheck: Date.now()
5757
});
58-
} catch (_) {
58+
} catch {
5959
// Expecting error code EACCES or EPERM
6060
const message =
6161
chalk().yellow(format(' %s update check failed ', options.pkg.name)) +
@@ -119,13 +119,13 @@ class UpdateNotifier {
119119
return this;
120120
}
121121

122-
options = Object.assign({
122+
options = {
123123
isGlobal: isInstalledGlobally(),
124-
isYarnGlobal: isYarnGlobal()()
125-
}, options);
124+
isYarnGlobal: isYarnGlobal()(),
125+
...options
126+
};
126127

127128
let installCommand;
128-
129129
if (options.isYarnGlobal) {
130130
installCommand = `yarn global add ${this.packageName}`;
131131
} else if (options.isGlobal) {

package.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
"url": "https://sindresorhus.com"
1212
},
1313
"engines": {
14-
"node": ">=8"
14+
"node": ">=10"
1515
},
1616
"scripts": {
17-
"test": "xo && ava --timeout=20s -s"
17+
"test": "xo && ava --timeout=20s --serial"
1818
},
1919
"files": [
2020
"index.js",
@@ -35,13 +35,13 @@
3535
],
3636
"dependencies": {
3737
"boxen": "^4.2.0",
38-
"chalk": "^3.0.0",
38+
"chalk": "^4.1.0",
3939
"configstore": "^5.0.1",
4040
"has-yarn": "^2.1.0",
4141
"import-lazy": "^2.1.0",
4242
"is-ci": "^2.0.0",
4343
"is-installed-globally": "^0.3.1",
44-
"is-npm": "^4.0.0",
44+
"is-npm": "^5.0.0",
4545
"is-yarn-global": "^0.3.0",
4646
"latest-version": "^5.0.0",
4747
"pupa": "^2.0.1",
@@ -55,11 +55,6 @@
5555
"fixture-stdout": "^0.2.1",
5656
"mock-require": "^3.0.3",
5757
"strip-ansi": "^6.0.0",
58-
"xo": "^0.25.0"
59-
},
60-
"xo": {
61-
"rules": {
62-
"prefer-object-spread": 0
63-
}
58+
"xo": "^0.33.1"
6459
}
6560
}

test/fs-error.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import test from 'ava';
44
let updateNotifier;
55

66
test.before(() => {
7-
['..', 'configstore', 'xdg-basedir'].forEach(clearModule);
7+
for (const name of ['..', 'configstore', 'xdg-basedir']) {
8+
clearModule(name);
9+
}
10+
811
// Set configstore.config to something that requires root access
912
process.env.XDG_CONFIG_HOME = '/usr';
1013
updateNotifier = require('..');

test/notify.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ function Control(shouldNotifyInNpmScript) {
1919
}
2020

2121
const setupTest = isNpmReturnValue => {
22-
['..', 'is-npm'].forEach(clearModule);
22+
for (const name of ['..', 'is-npm']) {
23+
clearModule(name);
24+
}
25+
2326
process.stdout.isTTY = true;
2427
mock('is-npm', {isNpmOrYarn: isNpmReturnValue || false});
2528
const updateNotifier = require('..');

0 commit comments

Comments
 (0)