// NOTE: According to the `stream-to-pull-stream` code, stdout/stderr behave differently from normal streams, and the `drain` event doesn't work correctly there. So instead, we use the flush callback to know when to write the next bit of data.
returnnewPromise((resolve,_reject)=>{
stream.write(value,(_error)=>{
// NOTE: We ignore any errors here, and wait for them to be thrown in the `error` event, to simplify the logic.