Pausing a stream() doesn't seem to have an effect - The parser proceeds reading the CSV as usual.
Take for example the following code:
const rs = fs.createReadStream(this.csvPath);
rs.pause();
let count = 0;
csv()
.fromStream(rs)
.on("json", (json) => {
count++;
console.log(count);
})
.on("done", () => {
cb(null, count);
})
.on("error", (err) => {
cb(err);
})
count is logged 200 times (equal to the amount of rows in the CSV) - I was expecting it not to log anything since the stream is paused before passing it over to fromStream()
Pausing a stream() doesn't seem to have an effect - The parser proceeds reading the CSV as usual.
Take for example the following code:
countis logged 200 times (equal to the amount of rows in the CSV) - I was expecting it not to log anything since the stream is paused before passing it over tofromStream()