diff --git a/doc/api/diagnostics_channel.md b/doc/api/diagnostics_channel.md index 98b11a9c01973f..715171ddb4298c 100644 --- a/doc/api/diagnostics_channel.md +++ b/doc/api/diagnostics_channel.md @@ -1319,6 +1319,14 @@ added: v16.18.0 Emitted when a new process is created. +`execve` + +* `execPath` {string} +* `args` {string\[]} +* `env` {string\[]} + +Emitted when [`process.execve()`][] is invoked. + #### Worker Thread + +> Stability: 1 - Experimental + +* `file` {string} The name or path of the executable file to run. +* `args` {string\[]} List of string arguments. No argument can contain a null-byte (`\u0000`). +* `env` {Object} Environment key-value pairs. + No key or value can contain a null-byte (`\u0000`). + **Default:** `process.env`. + +Replaces the current process with a new process. + +This is achieved by using the `execve` POSIX function and therefore no memory or other +resources from the current process are preserved, except for the standard input, +standard output and standard error file descriptor. + +All other resources are discarded by the system when the processes are swapped, without triggering +any exit or close events and without running any cleanup handler. + +This function will never return, unless an error occurred. + +This function is only available on POSIX platforms (i.e. not Windows or Android). + ## `process.report`