Skip to content

Commit dc1f389

Browse files
authored
swap in yargs for optimist and patch a few other security vulnerabilities (#157)
* swap in yargs for optimist and patch a few other vulns * isolate the require statement * drop node8 from test matrix * make the require look like it used to
1 parent 456a6af commit dc1f389

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
*.sw*
22
node_modules
33
static/reporter.js
4+
.nyc_output/
5+
package-lock.json

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
language: node_js
22
node_js:
3-
- 8
43
- 10
54
- 12
65
- 14

bin/bin.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env node
22

33
var run = require('..');
4-
var optimist = require('optimist');
4+
var yargs = require('yargs/yargs')
55

6-
var argv = optimist
6+
var argv = yargs(process.argv.slice(2))
77
.usage(
88
'Run JavaScript in a browser.\n' +
99
'Write code to stdin and receive console output on stdout.\n' +
@@ -34,13 +34,13 @@ var argv = optimist
3434

3535
.describe('basedir', 'Set this if you need to require node modules in node mode')
3636

37+
.help('h')
3738
.describe('help', 'Print help')
3839
.alias('h', 'help')
3940

4041
.argv;
4142

4243
argv.nodeIntegration = argv['node-integration']
43-
if (argv.help) return optimist.showHelp();
4444

4545
process.stdin
4646
.pipe(run(argv))

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323
"ecstatic": "^4.1.2",
2424
"electron-stream": "^8.0.0",
2525
"enstore": "^1.0.1",
26-
"html-inject-script": "^1.1.0",
27-
"optimist": "^0.6.1",
26+
"html-inject-script": "^2.0.0",
2827
"server-destroy": "^1.0.1",
2928
"source-map-support": "^0.4.0",
3029
"through": "^2.3.8",
3130
"xhr-write-stream": "^0.1.2",
32-
"xtend": "^4.0.1"
31+
"xtend": "^4.0.1",
32+
"yargs": "^16.2.0"
3333
},
3434
"devDependencies": {
3535
"browserify": "^14.1.0",
3636
"concat-stream": "^1.5.1",
3737
"np": "^6.2.3",
38-
"tap": "^10.0.1",
38+
"tap": "^14.11.0",
3939
"tree-kill": "^1.0.0",
4040
"utf8-stream": "^0.0.0"
4141
},

0 commit comments

Comments
 (0)