Open YuriFontella opened 1 year ago
end event headers before executing writable
when there is async/await in the headers event, the next pipe is executed before finalizing event headers
const readableStreamFile = fs.createReadStream('big.csv') const writableStreamFile = new Writable({ objectMode: true, async write(chunk, encoding, next) { console.log('writable') next() } }) readableStreamFile .pipe(csv()) .on('headers', async (headers) => { console.log('before headers') for await () {} // or await fecth() console.log('after headers') }) .pipe(writableStreamFile) // the output will be: // before headers // writable // after headers
My dream is to arrive at the writable with all the headers event code finalized.
Expected Behavior
end event headers before executing writable
Actual Behavior
when there is async/await in the headers event, the next pipe is executed before finalizing event headers
How Do We Reproduce?
My dream is to arrive at the writable with all the headers event code finalized.