fix: utilityProcess
pid should be undefined
after exit (#44693)
fix: utilityProcess pid should be undefined after exit Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
a6a0c4cb6d
commit
313f9030d2
3 changed files with 25 additions and 1 deletions
|
@ -92,6 +92,8 @@ the child process exits, then the value is `undefined` after the `exit` event is
|
|||
```js
|
||||
const child = utilityProcess.fork(path.join(__dirname, 'test.js'))
|
||||
|
||||
console.log(child.pid) // undefined
|
||||
|
||||
child.on('spawn', () => {
|
||||
console.log(child.pid) // Integer
|
||||
})
|
||||
|
@ -101,6 +103,8 @@ child.on('exit', () => {
|
|||
})
|
||||
```
|
||||
|
||||
**Note:** You can use the `pid` to determine if the process is currently running.
|
||||
|
||||
#### `child.stdout`
|
||||
|
||||
A `NodeJS.ReadableStream | null` that represents the child process's stdout.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue