Skip to content

Commit

Permalink
swap in yargs for optimist and patch a few other security vulnerabili…
Browse files Browse the repository at this point in the history
…ties (#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
  • Loading branch information
jgravois authored Jan 15, 2021
1 parent 456a6af commit dc1f389
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.sw*
node_modules
static/reporter.js
.nyc_output/
package-lock.json
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: node_js
node_js:
- 8
- 10
- 12
- 14
Expand Down
6 changes: 3 additions & 3 deletions bin/bin.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env node

var run = require('..');
var optimist = require('optimist');
var yargs = require('yargs/yargs')

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

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

.help('h')
.describe('help', 'Print help')
.alias('h', 'help')

.argv;

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

process.stdin
.pipe(run(argv))
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
"ecstatic": "^4.1.2",
"electron-stream": "^8.0.0",
"enstore": "^1.0.1",
"html-inject-script": "^1.1.0",
"optimist": "^0.6.1",
"html-inject-script": "^2.0.0",
"server-destroy": "^1.0.1",
"source-map-support": "^0.4.0",
"through": "^2.3.8",
"xhr-write-stream": "^0.1.2",
"xtend": "^4.0.1"
"xtend": "^4.0.1",
"yargs": "^16.2.0"
},
"devDependencies": {
"browserify": "^14.1.0",
"concat-stream": "^1.5.1",
"np": "^6.2.3",
"tap": "^10.0.1",
"tap": "^14.11.0",
"tree-kill": "^1.0.0",
"utf8-stream": "^0.0.0"
},
Expand Down

0 comments on commit dc1f389

Please sign in to comment.