Server IP : 127.0.0.2 / Your IP : 3.148.231.72 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/nodejs/npm/node_modules/opener/ |
Upload File : |
#!/usr/bin/nodejs "use strict"; var childProcess = require("child_process"); function opener(args, options, callback) { // http://stackoverflow.com/q/1480971/3191, but see below for Windows. var command = process.platform === "win32" ? "cmd" : process.platform === "darwin" ? "open" : "xdg-open"; if (typeof args === "string") { args = [args]; } if (typeof options === "function") { callback = options; options = {}; } if (options && typeof options === "object" && options.command) { if (process.platform === "win32") { // *always* use cmd on windows args = [options.command].concat(args); } else { command = options.command; } } 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 // // Additionally, on Windows ampersand needs to be escaped when passed to "start" args = args.map(function(value) { return value.replace(/&/g, '^&'); }); args = ["/c", "start", '""'].concat(args); } return childProcess.execFile(command, args, options, callback); } // Export `opener` for programmatic access. // You might use this to e.g. open a website: `opener("http://google.com")` module.exports = opener; // If we're being called from the command line, just execute, using the command-line arguments. if (require.main && require.main.id === module.id) { opener(process.argv.slice(2), function (error) { if (error) { throw error; } }); }