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

feat: support for full result object in node streams #1015

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

joequincy
Copy link

Why these changes

When using the DuplexStreamStreamer in node, the callback only receives the row data, instead of the full parse result object, however the library still generates per-row errors (if any) and metadata internally, which are useful when processing. For example, it would be helpful to be able to validate meta.renamedHeaders or check that errors is empty for the given row.

What does this PR change

Adds an optional configuration setting to provide the full result object to the callback (and corresponding tests). This allows PapaParse users to opt-in, since changing default behavior would be breaking. As with existing behavior when using streams, the result object (including both the error array and meta object) are atomic to the individual row sent to the callback.

Resolves #754

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

Successfully merging this pull request may close these issues.

Errors and meta fields when streaming
1 participant