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/api.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -211,7 +211,7 @@ This can only be called inside a subprocess. This requires the [`gracefulCancel`
211
211
## Return value
212
212
213
213
_TypeScript:_[`ResultPromise`](typescript.md)\
214
-
_Type:_`Promise<object> | Subprocess`
214
+
_Type:_`Subprocess`
215
215
216
216
The return value of all [asynchronous methods](#methods) is both:
217
217
- the [subprocess](#subprocess).
@@ -223,7 +223,9 @@ The return value of all [asynchronous methods](#methods) is both:
223
223
224
224
_TypeScript:_[`Subprocess`](typescript.md)
225
225
226
-
[`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with the following methods and properties.
226
+
Promise with the following Execa-specific methods and properties.
227
+
228
+
The underlying Node.js [`ChildProcess`](https://nodejs.org/api/child_process.html#class-childprocess) instance is available as [`subprocess.nodeChildProcess`](#subprocessnodechildprocess). This is an escape hatch for Node.js-specific APIs that Execa does not document, such as `.on()`, `.send()`, `.disconnect()`, `.ref()` and `.unref()`.
227
229
228
230
### subprocess\[Symbol.asyncIterator\]()
229
231
@@ -335,6 +337,14 @@ This is `undefined` if the subprocess failed to spawn.
Copy file name to clipboardExpand all lines: docs/execution.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,7 +127,7 @@ await timedExeca`npm run test`;
127
127
128
128
### Subprocess
129
129
130
-
The subprocess is returned as soon as it is spawned. It is a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) with [additional methods and properties](api.md#subprocess).
130
+
The subprocess is returned as soon as it is spawned. It is a `Promise` with [Execa-specific methods and properties](api.md#subprocess). The underlying Node.js [`ChildProcess`](https://nodejs.org/api/child_process.html#class-childprocess) is available as [`subprocess.nodeChildProcess`](api.md#subprocessnodechildprocess).
131
131
132
132
```js
133
133
constsubprocess= execa`npm run build`;
@@ -136,7 +136,7 @@ console.log(subprocess.pid);
136
136
137
137
### Result
138
138
139
-
The subprocess is also a `Promise` that resolves with the [`result`](api.md#result).
139
+
The subprocess resolves with the [`result`](api.md#result).
0 commit comments