Socket
Socket
Sign inDemoInstall

opener

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.2.0

20

opener.js

@@ -8,4 +8,4 @@ #!/usr/bin/env node

function opener(args, options, callback) {
// http://stackoverflow.com/q/1480971/3191
var command = process.platform === "win32" ? "start" :
// http://stackoverflow.com/q/1480971/3191, but see below for Windows.
var command = process.platform === "win32" ? "cmd" :
process.platform === "darwin" ? "open" :

@@ -18,11 +18,13 @@ "xdg-open";

if (process.platform === "win32" && args[0].indexOf(" ") !== -1) {
// Windows executables whose paths contain spaces need to be quoted.
args[0] = '"' + args[0];
// But, if you double-quote the first parameter, then `start` it will interpret it as a window title, so you
// need to add a dummy window title: http://stackoverflow.com/q/154075/#154090
args.unshift('""');
if (process.platform === "win32") {
// On Windows, we really want to use the "start" command. But, the rules regarding arguments with spaces, and
// escaping them with quotes, can get really arcane. So the easiest way to deal with this is to pass off the
// responsibility to "cmd /c", which has that logic built in.
//
// Furthermore, if "cmd /c" double-quoted the first parameter, then "start" will interpret it as a window title,
// so we need to add a dummy empty-string window title: http://stackoverflow.com/a/154090/3191
args = ["/c", "start", '""'].concat(args);
}
childProcess.exec(command + " " + args.join(" "), options, callback);
childProcess.execFile(command, args, options, callback);
}

@@ -29,0 +31,0 @@

{
"name": "opener",
"description": "Opens stuff, like webpages and files and executables, cross-platform",
"version": "1.1.0",
"version": "1.2.0",
"author": "Domenic Denicola <domenic@domenicdenicola.com> (http://domenicdenicola.com)",

@@ -6,0 +6,0 @@ "license": "WTFPL",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc