-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathopen.node.txt
32 lines (27 loc) · 1.94 KB
/
open.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
┏━━━━━━━━━━┓
┃ OPEN ┃
┗━━━━━━━━━━┛
VERSION ==> #10.1.0
OPEN('ARG'[, OPTS]) #Launch application, cross-OS.
->PROMISE_CHILD_PROCESS #Unless OPTS.app defined, guess which application to use (e.g. browser, file viewer, etc.).
#Runs CHILD_PROCESS.spawn() with:
# - Linux: xdg-open|COMMAND ARG COMMAND_ARGS...
# - Mac: open [-W] [-a COMMAND] ARG [--args COMMAND_OPTS]
# - Windows: powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -EncodedCommand [-Wait] [COMMAND] [COMMAND_OPTS...]
OPTS.app #OBJ
OPTS.app.name #'COMMAND'
apps.APP #OS-specific 'COMMAND' (e.g. 'google chrome' on Mac, 'google-chrome' on Linux).
#APP can be: 'chrome', 'firefox', 'edge', 'browser[Private]'
OPTS.app.arguments #'ARGS ...'
OPTS.wait #If true (def: false), wait for CHILD_PROCESS 'close|error' to resolve|reject PROMISE
OPTS.allowNonzeroExitCode #BOOL: if false (def), OPTS.wait true and exit code !== 0, rejects
OPTS.background #BOOL (def: false) (Mac only)
OPTS.newInstance #BOOL (def: false) (Mac only): open even if one already running
openApp('NAME'[, OPTS])
->PROMISE_CHILD_PROCESS #Same as OPEN(...) with OPTS.app.name 'NAME'
open-cli [ARG] #CLI
[-- COMMAND CMD_ARG...] #ARG can be stdin
#Version 8.0.0
--wait #
--background #
--extension=EXT #File type for when cannot guessed from stdin (most are automatically guessed)