(chunk: Buffer)
| 88 | }, 30_000); |
| 89 | |
| 90 | const onChunk = (chunk: Buffer): void => { |
| 91 | output += chunk.toString('utf-8'); |
| 92 | const match = output.match(/http:\/\/127\.0\.0\.1:(\d+)/); |
| 93 | if (match?.[1]) { |
| 94 | clearTimeout(timer); |
| 95 | resolve({ child, port: Number(match[1]), output: () => output }); |
| 96 | } |
| 97 | }; |
| 98 | child.stdout?.on('data', onChunk); |
| 99 | child.stderr?.on('data', onChunk); |
| 100 | child.on('error', (err) => { |