@@ -24,8 +24,8 @@ The ChildProcess class is not intended to be used directly. Use the
24
24
25
25
### Event: 'exit'
26
26
27
- * ` code ` Number, the exit code, if it exited normally.
28
- * ` signal ` String, the signal passed to kill the child process, if it
27
+ * ` code ` { Number} the exit code, if it exited normally.
28
+ * ` signal ` { String} the signal passed to kill the child process, if it
29
29
was killed by the parent.
30
30
31
31
This event is emitted after the child process ends. If the process terminated
@@ -44,7 +44,7 @@ An alternative way to check if you can send messages is to see if the
44
44
45
45
### child.stdin
46
46
47
- * Stream object
47
+ * { Stream object}
48
48
49
49
A ` Writable Stream ` that represents the child process's ` stdin ` .
50
50
Closing this stream via ` end() ` often causes the child process to terminate.
@@ -54,7 +54,7 @@ not be set.
54
54
55
55
### child.stdout
56
56
57
- * Stream object
57
+ * { Stream object}
58
58
59
59
A ` Readable Stream ` that represents the child process's ` stdout ` .
60
60
@@ -63,7 +63,7 @@ not be set.
63
63
64
64
### child.stderr
65
65
66
- * Stream object
66
+ * { Stream object}
67
67
68
68
A ` Readable Stream ` that represents the child process's ` stderr ` .
69
69
@@ -72,7 +72,7 @@ not be set.
72
72
73
73
### child.pid
74
74
75
- * Integer
75
+ * { Integer}
76
76
77
77
The PID of the child process.
78
78
@@ -86,7 +86,7 @@ Example:
86
86
87
87
### child.kill([ signal] )
88
88
89
- * ` signal ` String
89
+ * ` signal ` { String}
90
90
91
91
Send a signal to the child process. If no argument is given, the process will
92
92
be sent ` 'SIGTERM' ` . See ` signal(7) ` for a list of available signals.
@@ -108,24 +108,24 @@ See `kill(2)`
108
108
109
109
### child.send(message, [ sendHandle] )
110
110
111
- * ` message ` Object
112
- * ` sendHandle ` Handle object, Optional
111
+ * ` message ` { Object}
112
+ * ` sendHandle ` { Handle object}
113
113
114
114
Send a message (and, optionally, a handle object) to a child process.
115
115
116
116
See ` child_process.fork() ` for details.
117
117
118
118
## child_process.spawn(command, [ args] , [ options] )
119
119
120
- * ` command ` String - The command to run
121
- * ` args ` Array - List of string arguments, Optional
122
- * ` options ` Object, Optional
123
- * ` cwd ` String - Current working directory of the child process
124
- * ` customFds ` - ** Deprecated** File descriptors for the child to use
120
+ * ` command ` { String} The command to run
121
+ * ` args ` { Array} List of string arguments
122
+ * ` options ` { Object}
123
+ * ` cwd ` { String} Current working directory of the child process
124
+ * ` customFds ` {Array} ** Deprecated** File descriptors for the child to use
125
125
for stdio. (See below)
126
- * ` env ` Object - Environment key-value pairs
127
- * ` setsid ` Boolean
128
- * Return: ChildProcess object
126
+ * ` env ` { Object} Environment key-value pairs
127
+ * ` setsid ` { Boolean}
128
+ * return: { ChildProcess object}
129
129
130
130
Launches a new process with the given ` command ` , with command line arguments in ` args ` .
131
131
If omitted, ` args ` defaults to an empty Array.
@@ -230,18 +230,21 @@ See also: `child_process.exec()` and `child_process.fork()`
230
230
231
231
## child_process.exec(command, [ options] , callback)
232
232
233
- * ` command ` String - The command to run, with space-separated arguments
234
- * ` options ` Object, Optional
235
- * ` cwd ` String - Current working directory of the child process
236
- * ` customFds ` - ** Deprecated** File descriptors for the child to use
233
+ * ` command ` { String} The command to run, with space-separated arguments
234
+ * ` options ` { Object}
235
+ * ` cwd ` { String} Current working directory of the child process
236
+ * ` customFds ` {Array} ** Deprecated** File descriptors for the child to use
237
237
for stdio. (See below)
238
- * ` env ` Object - Environment key-value pairs
239
- * ` setsid ` Boolean
240
- * ` encoding ` String, Default: 'utf8'
241
- * ` timeout ` Number, Default: 0
242
- * ` maxBuffer ` Number, Default: 200* 1024
243
- * ` killSignal ` String, Default: 'SIGTERM'
244
- * ` callback ` Function called with the output when process terminates
238
+ * ` env ` {Object} Environment key-value pairs
239
+ * ` setsid ` {Boolean}
240
+ * ` encoding ` {String} (Default: 'utf8')
241
+ * ` timeout ` {Number} (Default: 0)
242
+ * ` maxBuffer ` {Number} (Default: 200* 1024)
243
+ * ` killSignal ` {String} (Default: 'SIGTERM')
244
+ * ` callback ` {Function} called with the output when process terminates
245
+ * ` code ` {Integer} Exit code
246
+ * ` stdout ` {Buffer}
247
+ * ` stderr ` {Buffer}
245
248
* Return: ChildProcess object
246
249
247
250
Runs a command in a shell and buffers the output.
@@ -283,37 +286,45 @@ the child process is killed.
283
286
284
287
## child_process.execFile(file, args, options, callback)
285
288
286
- * ` command ` String - The command to run, with space-separated arguments
287
- * ` options ` Object, Optional
288
- * ` cwd ` String - Current working directory of the child process
289
- * ` customFds ` - ** Deprecated** File descriptors for the child to use
289
+ * ` file ` {String} The filename of the program to run
290
+ * ` args ` {Array} List of string arguments
291
+ * ` options ` {Object}
292
+ * ` cwd ` {String} Current working directory of the child process
293
+ * ` customFds ` {Array} ** Deprecated** File descriptors for the child to use
290
294
for stdio. (See below)
291
- * ` env ` Object - Environment key-value pairs
292
- * ` setsid ` Boolean
293
- * ` encoding ` String, Default: 'utf8'
294
- * ` timeout ` Number, Default: 0
295
- * ` maxBuffer ` Number, Default: 200* 1024
296
- * ` killSignal ` String, Default: 'SIGTERM'
297
- * ` callback ` Function called with the output when process terminates
295
+ * ` env ` {Object} Environment key-value pairs
296
+ * ` setsid ` {Boolean}
297
+ * ` encoding ` {String} (Default: 'utf8')
298
+ * ` timeout ` {Number} (Default: 0)
299
+ * ` maxBuffer ` {Number} (Default: 200* 1024)
300
+ * ` killSignal ` {String} (Default: 'SIGTERM')
301
+ * ` callback ` {Function} called with the output when process terminates
302
+ * ` code ` {Integer} Exit code
303
+ * ` stdout ` {Buffer}
304
+ * ` stderr ` {Buffer}
298
305
* Return: ChildProcess object
299
306
300
307
This is similar to ` child_process.exec() ` except it does not execute a
301
308
subshell but rather the specified file directly. This makes it slightly
302
309
leaner than ` child_process.exec ` . It has the same options.
303
310
304
311
305
- ## child_process.fork(modulePath, [ arguments ] , [ options] )
312
+ ## child_process.fork(modulePath, [ args ] , [ options] )
306
313
307
- * ` command ` String - The command to run, with space-separated arguments
308
- * ` options ` Object, Optional
309
- * ` cwd ` String - Current working directory of the child process
310
- * ` customFds ` - ** Deprecated** File descriptors for the child to use
314
+ * ` modulePath ` {String} The module to run in the child
315
+ * ` args ` {Array} List of string arguments
316
+ * ` options ` {Object}
317
+ * ` cwd ` {String} Current working directory of the child process
318
+ * ` customFds ` {Array} ** Deprecated** File descriptors for the child to use
311
319
for stdio. (See below)
312
- * ` env ` Object - Environment key-value pairs
313
- * ` setsid ` Boolean
314
- * ` silent ` Boolean, If true, child doesn't write to parent's stdout
315
- and stderr.
316
- * ` callback ` Function called with the output when process terminates
320
+ * ` env ` {Object} Environment key-value pairs
321
+ * ` setsid ` {Boolean}
322
+ * ` encoding ` {String} (Default: 'utf8')
323
+ * ` timeout ` {Number} (Default: 0)
324
+ * ` callback ` {Function} called with the output when process terminates
325
+ * ` code ` {Integer} Exit code
326
+ * ` stdout ` {Buffer}
327
+ * ` stderr ` {Buffer}
317
328
* Return: ChildProcess object
318
329
319
330
This is a special case of the ` spawn() ` functionality for spawning Node
0 commit comments