Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b2ddf0f

Browse filesBrowse 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 <vieuxtech@gmail.com>
1 parent 2034f68 commit b2ddf0f
Copy full SHA for b2ddf0f

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Open diff view settings
Collapse file

‎doc/api/process.markdown‎

Copy file name to clipboardExpand all lines: doc/api/process.markdown
+5-5Lines changed: 5 additions & 5 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.