From 19b79dbde84a81fb5206f1f47fcba080e43da396 Mon Sep 17 00:00:00 2001 From: Jeremy Swanson Date: Sun, 27 May 2018 18:41:54 -0700 Subject: [PATCH] Replace unmaintained open package with opn. open is unmaintained and has a critical vulnerability issue: https://github.com/pwnall/node-open/issues/67. opn is pretty much a drop in replacement. --- lib/reload-server.js | 4 ++-- package-lock.json | 16 ++++++++++++---- package.json | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/reload-server.js b/lib/reload-server.js index c855b60..2876eaf 100644 --- a/lib/reload-server.js +++ b/lib/reload-server.js @@ -1,7 +1,7 @@ var http = require('http') var reload = require('../lib/reload') var fs = require('fs') -var open = require('open') +var opn = require('opn') var clc = require('cli-color') var argv = require('minimist')(process.argv.slice(2)) @@ -70,7 +70,7 @@ server.listen(port, function () { // If openBrowser, open the browser with the given start page above, at a hostname (localhost default or specified). if (openBrowser) { - open('http://' + hostname + ':' + port) + opn('http://' + hostname + ':' + port) } } else { time = new Date() diff --git a/package-lock.json b/package-lock.json index e4f4fd2..6f2370b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1045,6 +1045,11 @@ "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", "dev": true }, + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=" + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -1279,10 +1284,13 @@ "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", "dev": true }, - "open": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/open/-/open-0.0.5.tgz", - "integrity": "sha1-QsPhjslUZra/DcQvOilFw/DK2Pw=" + "opn": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/opn/-/opn-5.3.0.tgz", + "integrity": "sha512-bYJHo/LOmoTd+pfiYhfZDnf9zekVJrY+cnS2a5F2x+w5ppvTqObojTP7WiFG+kVZs9Inw+qQ/lw7TroWwhdd2g==", + "requires": { + "is-wsl": "^1.1.0" + } }, "optionator": { "version": "0.8.2", diff --git a/package.json b/package.json index 10ae3b3..f9dee49 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "commander": "~2.9.0", "finalhandler": "^1.1.1", "minimist": "~1.2.0", - "open": "~0.0.5", + "opn": "^5.3.0", "serve-static": "^1.13.2", "supervisor": "~0.12.0", "url-parse": "~1.1.9",