(stream: NodeJS.WriteStream, data: string)
| 15 | } |
| 16 | |
| 17 | function writeOut(stream: NodeJS.WriteStream, data: string): void { |
| 18 | if (stream.destroyed) { |
| 19 | return |
| 20 | } |
| 21 | |
| 22 | // Note: we don't handle backpressure (write() returning false). |
| 23 | // |
| 24 | // We should consider handling the callback to ensure we wait for data to flush. |
| 25 | stream.write(data /* callback to handle here */) |
| 26 | } |
| 27 | |
| 28 | export function writeToStdout(data: string): void { |
| 29 | writeOut(process.stdout, data) |
no test coverage detected