Skip to content

Commit

Permalink
feat(csv-issues-cjs): 399 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Aug 24, 2023
1 parent 1eac79b commit b8df8db
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions demo/issues-cjs/lib/399.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
""
value
18 changes: 18 additions & 0 deletions demo/issues-cjs/lib/399.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const fs = require('fs');
const { parse: parseCsv } = require("csv-parse");

async function main() {
const parser1 = fs.createReadStream(__dirname + '/399.csv').pipe(parseCsv());
const parser2 = fs.createReadStream(__dirname + '/399.csv').pipe(parseCsv({relax_quotes:true,from_line:2}));
setImmediate(async () => {
for await (record of parser1) {
console.log(record);
}
})
setImmediate(async () => {
for await (record of parser2) {
console.log(record);
}
})
}
main();

0 comments on commit b8df8db

Please sign in to comment.