Skip to content

Commit b69fdd0

Browse files
committed
use const/let instead of var
1 parent 3133460 commit b69fdd0

File tree

4 files changed

+119
-119
lines changed

4 files changed

+119
-119
lines changed

bin/wait-on

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env node
22

3-
var fs = require('fs');
4-
var minimist = require('minimist');
5-
var path = require('path');
6-
var waitOn = require('../');
3+
const fs = require('fs');
4+
const minimist = require('minimist');
5+
const path = require('path');
6+
const waitOn = require('../');
77

8-
var minimistOpts = {
8+
const minimistOpts = {
99
string: ['c', 'd', 'i', 's', 't', 'w', 'httpTimeout', 'tcpTimeout'],
1010
boolean: ['h', 'l', 'r', 'v'],
1111
alias: {
@@ -18,24 +18,24 @@ var minimistOpts = {
1818
t: 'timeout',
1919
v: 'verbose',
2020
w: 'window',
21-
h: 'help'
22-
}
21+
h: 'help',
22+
},
2323
};
2424

25-
var argv = minimist(process.argv.slice(2), minimistOpts);
25+
const argv = minimist(process.argv.slice(2), minimistOpts);
2626

2727
if (argv.help || !argv._.length) {
2828
// help
2929
fs.createReadStream(path.join(__dirname, '/usage.txt'))
3030
.pipe(process.stdout)
31-
.on('close', function() {
31+
.on('close', function () {
3232
process.exit(1);
3333
});
3434
} else {
35-
var opts = {};
35+
let opts = {};
3636

3737
// if a js/json configuration file is provided require it
38-
var configFile = argv.config;
38+
const configFile = argv.config;
3939
if (configFile) {
4040
opts = require(path.resolve(configFile));
4141
}
@@ -54,15 +54,15 @@ if (argv.help || !argv._.length) {
5454
'timeout',
5555
'tcpTimeout',
5656
'verbose',
57-
'window'
58-
].reduce(function(accum, x) {
57+
'window',
58+
].reduce(function (accum, x) {
5959
if (argv[x]) {
6060
accum[x] = argv[x];
6161
}
6262
return accum;
6363
}, opts);
6464

65-
waitOn(opts, function(err) {
65+
waitOn(opts, function (err) {
6666
if (err) {
6767
return errorExit(err);
6868
}

0 commit comments

Comments
 (0)