You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/output.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,12 +32,19 @@ console.log(stderr); // string with errors
32
32
awaitexeca({stdout: {file:'output.txt'}})`npm run build`;
33
33
// Or:
34
34
awaitexeca({stdout:newURL('file:///path/to/output.txt')})`npm run build`;
35
+
```
35
36
37
+
```js
36
38
// Redirect interleaved stdout and stderr to same file
37
39
constoutput= {file:'output.txt'};
38
40
awaitexeca({stdout: output, stderr: output})`npm run build`;
39
41
```
40
42
43
+
```js
44
+
// Append instead of overwriting
45
+
awaitexeca({stdout: {file:'output.txt', append:true}})`npm run build`;
46
+
```
47
+
41
48
## Terminal output
42
49
43
50
The parent process' output can be re-used in the subprocess by passing `'inherit'`. This is especially useful to print to the terminal in command line applications.
0 commit comments