Skip to content

Commit b2ddf0f

Browse files
TrottFishrock123
authored andcommitted
doc: refine process.kill() and exit explanations
Add corrections about when exit event fires and how .kill() works on Windows. PR-URL: #2918 Reviewed-By: Sam Roberts <[email protected]>
1 parent 2034f68 commit b2ddf0f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

doc/api/process.markdown

+5-5
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ finished running the process will exit. Therefore you **must** only perform
5959
checks on the module's state (like for unit tests). The callback takes one
6060
argument, the code the process is exiting with.
6161

62-
This event may not be fired if the process terminates due to signals like
63-
`SIGINT`, `SIGTERM`, `SIGKILL`, and `SIGHUP`.
62+
This event is only emitted when node exits explicitly by process.exit() or
63+
implicitly by the event loop draining.
6464

6565
Example of listening for `exit`:
6666

@@ -240,12 +240,12 @@ Note:
240240
- `SIGKILL` cannot have a listener installed, it will unconditionally terminate
241241
Node.js on all platforms.
242242
- `SIGSTOP` cannot have a listener installed.
243-
- Sending `SIGINT`, `SIGTERM`, and `SIGKILL` cause the unconditional exit of the
244-
target process.
245243

246244
Note that Windows does not support sending Signals, but Node.js offers some
247245
emulation with `process.kill()`, and `child_process.kill()`. Sending signal `0`
248-
can be used to test for the existence of a process
246+
can be used to test for the existence of a process. Sending `SIGINT`,
247+
`SIGTERM`, and `SIGKILL` cause the unconditional termination of the target
248+
process.
249249

250250
## process.stdout
251251

0 commit comments

Comments
 (0)