@@ -10,9 +10,9 @@ It is possible to stream data through a child's `stdin`, `stdout`, and
10
10
line-buffered I/O internally. That doesn't affect Node.js but it means
11
11
data you send to the child process may not be immediately consumed.)
12
12
13
- To create a child process use ` require('child_process').spawn() ` or
13
+ To create a child process, use ` require('child_process').spawn() ` or
14
14
` require('child_process').fork() ` . The semantics of each are slightly
15
- different, and explained [ below] [ ] .
15
+ different as explained [ below] [ ] .
16
16
17
17
For scripting purposes you may find the [ synchronous counterparts] [ ] more
18
18
convenient.
@@ -54,11 +54,11 @@ Emitted when:
54
54
55
55
1 . The process could not be spawned, or
56
56
2 . The process could not be killed, or
57
- 3 . Sending a message to the child process failed for whatever reason .
57
+ 3 . Sending a message to the child process failed.
58
58
59
- Note that the ` 'exit' ` event may or may not fire after an error has occurred. If
60
- you are listening on both events to fire a function, remember to guard against
61
- calling your function twice.
59
+ Note that the ` 'exit' ` event may or may not fire after an error has occurred.
60
+ If you are listening on both events to fire a function, remember to guard
61
+ against calling your function twice.
62
62
63
63
See also [ ` ChildProcess#kill() ` ] [ ] and [ ` ChildProcess#send() ` ] [ ] .
64
64
@@ -76,8 +76,7 @@ of the signal, otherwise `null`.
76
76
Note that the child process stdio streams might still be open.
77
77
78
78
Also, note that Node.js establishes signal handlers for ` SIGINT ` and
79
- ` SIGTERM ` , so it will not terminate due to receipt of those signals,
80
- it will exit.
79
+ ` SIGTERM ` . It will not terminate due to receipt of those signals. It will exit.
81
80
82
81
See ` waitpid(2) ` .
83
82
@@ -103,8 +102,8 @@ gracefully once there are no other connections keeping it alive. After calling
103
102
this method the ` .connected ` flag will be set to ` false ` in both the parent and
104
103
child, and it is no longer possible to send messages.
105
104
106
- The ` 'disconnect' ` event will be emitted when there are no messages in the process
107
- of being received, most likely immediately.
105
+ The ` 'disconnect' ` event will be emitted when there are no messages in the
106
+ process of being received, most likely immediately.
108
107
109
108
Note that you can also call ` process.disconnect() ` in the child process when the
110
109
child process has any open IPC channels with the parent (i.e [ ` fork() ` ] [ ] ).
@@ -128,9 +127,9 @@ be sent `'SIGTERM'`. See `signal(7)` for a list of available signals.
128
127
129
128
May emit an ` 'error' ` event when the signal cannot be delivered. Sending a
130
129
signal to a child process that has already exited is not an error but may
131
- have unforeseen consequences: if the PID (the process ID ) has been reassigned
132
- to another process, the signal will be delivered to that process instead.
133
- What happens next is anyone's guess.
130
+ have unforeseen consequences. Specifically, if the process identifier (PID ) has
131
+ been reassigned to another process, the signal will be delivered to that
132
+ process instead. What happens next is anyone's guess.
134
133
135
134
Note that while the function is called ` kill ` , the signal delivered to the
136
135
child process may not actually kill it. ` kill ` really just sends a signal
@@ -142,7 +141,7 @@ See `kill(2)`
142
141
143
142
* {Integer}
144
143
145
- The PID of the child process.
144
+ The process identifier ( PID) of the child process.
146
145
147
146
Example:
148
147
@@ -183,7 +182,7 @@ And then the child script, `'sub.js'` might look like this:
183
182
184
183
process.send({ foo: 'bar' });
185
184
186
- In the child the ` process ` object will have a ` send() ` method, and ` process `
185
+ In the child, the ` process ` object will have a ` send() ` method, and ` process `
187
186
will emit objects each time it receives a message on its channel.
188
187
189
188
There is a special case when sending a ` {cmd: 'NODE_foo'} ` message. All messages
0 commit comments