MCPcopy Create free account
hub / github.com/sindresorhus/execa / waitForSubprocessStream

Function waitForSubprocessStream

lib/resolve/stdio.js:19–47  ·  view source on GitHub ↗
({stream, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline, verboseInfo, streamInfo})

Source from the content-addressed store, hash-verified

17
18// Read the contents of `subprocess.std*` or `subprocess.all` and|or wait for its completion
19export const waitForSubprocessStream = async ({stream, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline, verboseInfo, streamInfo}) => {
20 if (!stream) {
21 return;
22 }
23
24 const onStreamEnd = waitForStream(stream, fdNumber, streamInfo);
25 if (isInputFileDescriptor(streamInfo, fdNumber)) {
26 await onStreamEnd;
27 return;
28 }
29
30 const [output] = await Promise.all([
31 getStreamOutput({
32 stream,
33 onStreamEnd,
34 fdNumber,
35 encoding,
36 buffer,
37 maxBuffer,
38 lines,
39 allMixed,
40 stripFinalNewline,
41 verboseInfo,
42 streamInfo,
43 }),
44 onStreamEnd,
45 ]);
46 return output;
47};

Callers 2

waitForAllStreamFunction · 0.90
waitForStdioStreamsFunction · 0.85

Calls 3

waitForStreamFunction · 0.90
isInputFileDescriptorFunction · 0.90
getStreamOutputFunction · 0.90

Tested by

no test coverage detected