Waits for child to print something to its stdout and/or stderr. Returns a promise that:
will resolve with the message that matched predicate or
will reject if child exited or errored before printing a message that matched predicate
Arguments:
child: the ChildProcess to listen to
predicate: childPrinted will wait until child's stream(s) output a message matching the predicate
stream: which of child's streams to listen to, omit to listen to both stdout and stderr
Example:
import {exec} from 'child_process'import {childPrinted} from 'async-child-process'async function test() { const child = exec(`webpack --config webpack.config.dev.js`) await childPrinted(child, /webpack built in \d+ ms/)}