@@ -59,6 +59,9 @@ finished running the process will exit. Therefore you **must** only perform
59
59
checks on the module's state (like for unit tests). The callback takes one
60
60
argument, the code the process is exiting with.
61
61
62
+ This event may not be fired if the process terminates due to signals like
63
+ ` SIGINT ` , ` SIGTERM ` , ` SIGKILL ` , and ` SIGHUP ` .
64
+
62
65
Example of listening for ` exit ` :
63
66
64
67
process.on('exit', function(code) {
@@ -218,7 +221,7 @@ Note:
218
221
the terminal mode before exiting with code ` 128 + signal number ` . If one of
219
222
these signals has a listener installed, its default behavior will be removed
220
223
(Node.js will no longer exit).
221
- - ` SIGPIPE ` is ignored by default, it can have a listener installed.
224
+ - ` SIGPIPE ` is ignored by default. It can have a listener installed.
222
225
- ` SIGHUP ` is generated on Windows when the console window is closed, and on other
223
226
platforms under various similar conditions, see signal(7). It can have a
224
227
listener installed, however Node.js will be unconditionally terminated by
@@ -237,13 +240,13 @@ Note:
237
240
- ` SIGKILL ` cannot have a listener installed, it will unconditionally terminate
238
241
Node.js on all platforms.
239
242
- ` SIGSTOP ` cannot have a listener installed.
240
-
241
- Note that Windows does not support sending Signals, but Node.js offers some
242
- emulation with ` process.kill() ` , and ` child_process.kill() ` :
243
- - Sending signal ` 0 ` can be used to search for the existence of a process
244
243
- Sending ` SIGINT ` , ` SIGTERM ` , and ` SIGKILL ` cause the unconditional exit of the
245
244
target process.
246
245
246
+ Note that Windows does not support sending Signals, but Node.js offers some
247
+ emulation with ` process.kill() ` , and ` child_process.kill() ` . Sending signal ` 0 `
248
+ can be used to test for the existence of a process
249
+
247
250
## process.stdout
248
251
249
252
A ` Writable Stream ` to ` stdout ` (on fd ` 1 ` ).
@@ -714,12 +717,12 @@ string describing the signal to send. Signal names are strings like
714
717
'SIGINT' or 'SIGHUP'. If omitted, the signal will be 'SIGTERM'.
715
718
See [ Signal Events] ( #process_signal_events ) and kill(2) for more information.
716
719
717
- Will throw an error if target does not exist, and as a special case, a signal of
718
- ` 0 ` can be used to test for the existence of a process.
720
+ Will throw an error if target does not exist, and as a special case, a signal
721
+ of ` 0 ` can be used to test for the existence of a process.
719
722
720
- Note that just because the name of this function is ` process.kill ` , it is
721
- really just a signal sender, like the ` kill ` system call. The signal sent
722
- may do something other than kill the target process.
723
+ Note that even though the name of this function is ` process.kill ` , it is really
724
+ just a signal sender, like the ` kill ` system call. The signal sent may do
725
+ something other than kill the target process.
723
726
724
727
Example of sending a signal to yourself:
725
728
0 commit comments