Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When bom and skipRecordsWithError skip event is not raised for skipped records #411

Open
omerlh opened this issue Dec 7, 2023 · 0 comments

Comments

@omerlh
Copy link

omerlh commented Dec 7, 2023

Describe the bug

Setting both options results in csv file parsed correctly but no event is fired for skipped lines.

To Reproduce

import { createReadStream } from 'node:fs';
import { finished } from 'node:stream/promises';
import { parse } from 'csv-parse';

const parser = parse({
  bom: true,
  skipRecordsWithError: true,
});

const outStream = createReadStream('tests/closed-box/fixtures/data-with-bom.csv').pipe(parser);

outStream.on('skip', (e) => {
  console.error(e);
});


await finished(outStream);

I would expect the console error to be called but it doesn't. When removing the bom option and using something like strip-bom-stream the event is fired correctly.

Additional context
data-with-bom.csv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant