(data)
| 96 | } |
| 97 | |
| 98 | function handleStderr(data) { |
| 99 | const message = data.toString() |
| 100 | if (failRegexp && failRegexp.test(message)) { |
| 101 | instance.kill() |
| 102 | return reject(new Error('received failRegexp')) |
| 103 | } |
| 104 | process.stderr.write(message) |
| 105 | |
| 106 | if (opts && opts.onStderr) { |
| 107 | opts.onStderr(message.toString()) |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | if (opts?.shouldRejectOnError) { |
| 112 | instance.on('exit', (code) => { |