Skip to content

child_process: truncate output when maxBuffer is exceeded

Preserves truncated output for child_process.exec() when maxBuffer is exceeded.

This is particularly useful for commands which have indistinguishable error codes for what output they produce.


I am presently running into this and just vendoring exec with a similar change into some code because... well, I need it, and don't want to re-write all of exec by hand.

Done as an added option / semver-minor because I want it sooner. IMO we should make this the default behavior but I think there's a chance something relies on the old behavior. Done as patch as per discussion.

The old behavior was also completely untested so... commit 1 fixes that.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading