-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Option to don't use an output buffer on child_process sync methods #9057
Comments
Have you tried setting the child's stdout and stderr to |
Setting On the other hand, setting |
I'd take a doc patch for this. |
Ok, so it's not manually stored in a buffer but instead it's using the
I think would be usual to ignore (a long) stdout but not stderr, so it Definitely, the docs are not clear for this use cases... :-/ "Si quieres viajar alrededor del mundo y ser invitado a hablar en un |
That's already how it works. Output is only captured when the stdio mode is
I agree. |
Cool! Then I need to test it.
Ok, it's better to return null that an empty Buffer object, it's more explicit. "Si quieres viajar alrededor del mundo y ser invitado a hablar en un |
The child_process.exec documentation says:
and I assume this also apply to
child_process.execFile
,child_process.spawnSync
,child_process.execFileSync
andchild_process.execSync
, since all of them has themaxBuffer
option.To create scripts that exec commands that give a HUGE output (like
make
) this can be a problem, specially since you don't know how big they can be and at the same time, you are not worried to store their output (showing it on the console it's usually enough) and also they would waste a lot of memory in useless data, so I propose to add an option to don't buffer the output at all. A good way to enable this is to setmaxBuffer
to a negative number (a special case ofmaxNumber = 0
would be still a valid value when you don't expect the command to give an output at all, and if so it's due to an error...).The text was updated successfully, but these errors were encountered: