You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 20, 2026. It is now read-only.
My understanding of pause() with respect to streaming a csv would be to pause the stream at the current record. This would allow async processing to occur before resuming the stream to get the next record.
What's currently happening is the buffer is fully processed before _paused is taken into account.
varcount=0;varcsvStream=newcsv.createStream({endLine : '\n',escapeChar : '"',enclosedChar: '"'})varreadStream=fs.createReadStream(targetPath)csvStream.on('error',function(err){console.log(err)})csvStream.on('data',function(data){count++console.log('pre pause',count)csvStream.pause()//I would normally have async code here with a csvStream.resume() in a callback/promise })csvStream.on('end',function(){console.log("we're done")//cb()})readStream.pipe(csvStream)
I would expect the stream to pause at each record, but it goes through until the end of file (or buffer in this case) before actually entering the paused state.
Is the intended behaviour to process the entire file/buffer before allowing pause() to occur?
My understanding of pause() with respect to streaming a csv would be to pause the stream at the current record. This would allow async processing to occur before resuming the stream to get the next record.
What's currently happening is the buffer is fully processed before _paused is taken into account.
I would expect the stream to pause at each record, but it goes through until the end of file (or buffer in this case) before actually entering the paused state.
Is the intended behaviour to process the entire file/buffer before allowing pause() to occur?