Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 1ab144a

Browse files
committed
docs: be specific about the unit of maxBuffer
the maxBuffer option was not self-documenting, so document unit and its effect.
1 parent cfcb1de commit 1ab144a

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

doc/api/child_process.markdown

+12-7
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,8 @@ See also: `child_process.exec()` and `child_process.fork()`
485485
understand the `-c` switch on UNIX or `/s /c` on Windows. On Windows,
486486
command line parsing should be compatible with `cmd.exe`.)
487487
* `timeout` {Number} (Default: 0)
488-
* `maxBuffer` {Number} (Default: `200*1024`)
488+
* `maxBuffer` {Number} largest amount of data (in bytes) allowed on stdout or
489+
stderr - if exceeded child process is killed (Default: `200*1024`)
489490
* `killSignal` {String} (Default: 'SIGTERM')
490491
* `uid` {Number} Sets the user identity of the process. (See setuid(2).)
491492
* `gid` {Number} Sets the group identity of the process. (See setgid(2).)
@@ -527,8 +528,8 @@ default options are
527528
If `timeout` is greater than 0, then it will kill the child process
528529
if it runs longer than `timeout` milliseconds. The child process is killed with
529530
`killSignal` (default: `'SIGTERM'`). `maxBuffer` specifies the largest
530-
amount of data allowed on stdout or stderr - if this value is exceeded then
531-
the child process is killed.
531+
amount of data (in bytes) allowed on stdout or stderr - if this value is
532+
exceeded then the child process is killed.
532533

533534

534535
### child_process.execFile(file, [args], [options], [callback])
@@ -540,7 +541,8 @@ the child process is killed.
540541
* `env` {Object} Environment key-value pairs
541542
* `encoding` {String} (Default: 'utf8')
542543
* `timeout` {Number} (Default: 0)
543-
* `maxBuffer` {Number} (Default: 200\*1024)
544+
* `maxBuffer` {Number} largest amount of data (in bytes) allowed on stdout or
545+
stderr - if exceeded child process is killed (Default: 200\*1024)
544546
* `killSignal` {String} (Default: 'SIGTERM')
545547
* `uid` {Number} Sets the user identity of the process. (See setuid(2).)
546548
* `gid` {Number} Sets the group identity of the process. (See setgid(2).)
@@ -612,7 +614,8 @@ configuration at startup.
612614
* `gid` {Number} Sets the group identity of the process. (See setgid(2).)
613615
* `timeout` {Number} In milliseconds the maximum amount of time the process is allowed to run. (Default: undefined)
614616
* `killSignal` {String} The signal value to be used when the spawned process will be killed. (Default: 'SIGTERM')
615-
* `maxBuffer` {Number}
617+
* `maxBuffer` {Number} largest amount of data (in bytes) allowed on stdout or
618+
stderr - if exceeded child process is killed
616619
* `encoding` {String} The encoding used for all stdio inputs and outputs. (Default: 'buffer')
617620
* return: {Object}
618621
* `pid` {Number} Pid of the child process
@@ -645,7 +648,8 @@ process has exited.
645648
* `gid` {Number} Sets the group identity of the process. (See setgid(2).)
646649
* `timeout` {Number} In milliseconds the maximum amount of time the process is allowed to run. (Default: undefined)
647650
* `killSignal` {String} The signal value to be used when the spawned process will be killed. (Default: 'SIGTERM')
648-
* `maxBuffer` {Number}
651+
* `maxBuffer` {Number} largest amount of data (in bytes) allowed on stdout or
652+
stderr - if exceeded child process is killed
649653
* `encoding` {String} The encoding used for all stdio inputs and outputs. (Default: 'buffer')
650654
* return: {Buffer|String} The stdout from the command
651655

@@ -675,7 +679,8 @@ throw. The `Error` object will contain the entire result from
675679
* `gid` {Number} Sets the group identity of the process. (See setgid(2).)
676680
* `timeout` {Number} In milliseconds the maximum amount of time the process is allowed to run. (Default: undefined)
677681
* `killSignal` {String} The signal value to be used when the spawned process will be killed. (Default: 'SIGTERM')
678-
* `maxBuffer` {Number}
682+
* `maxBuffer` {Number} largest amount of data (in bytes) allowed on stdout or
683+
stderr - if exceeded child process is killed
679684
* `encoding` {String} The encoding used for all stdio inputs and outputs. (Default: 'buffer')
680685
* return: {Buffer|String} The stdout from the command
681686

0 commit comments

Comments
 (0)