-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdeno_command.deno.txt
45 lines (39 loc) · 2.34 KB
/
deno_command.deno.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
33
34
35
36
37
38
39
40
41
42
43
44
45
┏━━━━━━━━━━━━━━━━━━┓
┃ DENO_COMMAND ┃
┗━━━━━━━━━━━━━━━━━━┛
VERSION ==> #See deno doc
new Deno.Command(UPATH[, OPTS]) #COMMAND, i.e. configuration for CHILD_PROCESSs
#Does not use any shell.
OPTS.args #'ARG'_ARR (def: [])
OPTS.env #ENVVAR_OBJ
OPTS.clearEnv #BOOL. If false (def), merge OPTS.env with parent ENVVARs instead of overwriting
OPTS.cwd #DIR_UPATH (def: current)
OPTS.uid|gid #NUM (def: current)
OPTS.signal #ABORT_SIGNAL, calling kill()
#Not with outputSync()
OPTS.windowsRawArguments #BOOL (def: false). No shell escaping, i.e. can use cmd.exe syntax.
#Only with Windows.
COMMAND.spawn()->CHILD_PROCESS U#Start a new process, do not wait for exit
CHILD_PROCESS.pid #NUM
CHILD_PROCESS.[un]ref() #Set whether ref'd by the current process
CHILD_PROCESS.status #>COMMAND_STATUS
COMMAND|CHILD_PROCESS.output()
->>COMMAND_OUTPUT
COMMAND.outputSync()
->COMMAND_OUTPUT U#Start a new process, wait for exit
COMMAND_STATUS|OUTPUT.code #Exit code NUM
COMMAND_STATUS|OUTPUT.signal #SIGNAL|null terminating the process
COMMAND_STATUS|OUTPUT.success #BOOL. true if exit code non-0
OPTS.stdin|stdout|stderr #One of:
# - 'inherit': redirect from parent
# - 'piped':
# - use CHILD_PROCESS|COMMAND_OUTPUT.stdin|stdout|stderr
# - unless set, they throw
# - 'null': ignore
#Def:
# - spawn(): 'inherit'
# - output(): 'inherit' with stdin, 'piped' with stdout|stderr
CHILD_PROCESS.stdin #WSTREAM
#Must manually stdin.close() (if 'piped')
CHILD_PROCESS.stdout|stderr #RSTREAM
COMMAND_OUTPUT.stdout|stderr #UINT8ARR