Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Implement header (and footer) support #108

Merged
merged 3 commits into from
Sep 24, 2016
Merged

Conversation

doowb
Copy link
Collaborator

@doowb doowb commented Sep 21, 2016

This PR implements emitting a header and footer event with data that comes before and after the specified path. This is implemented in a way that when the specified path is first found, if the header object has been populated, it's emitted immediately so the entire document doesn't need to be read in.

The footer contains the remaining properties (if any) after the values in the specified path have been exhausted. I believe my logic is correct since the current tests are still passing.

I think this address #99 and #93.

I tried to keep with the current coding style, so please let me know if there is something that I need to change.

Thanks!

@dominictarr
Copy link
Owner

thanks this looks like a great pull request, will merge. do you mind if I also add you as a collaborator?

@doowb
Copy link
Collaborator Author

doowb commented Sep 23, 2016

do you mind if I also add you as a collaborator?

I don't mind, that'd be great. I'm happy to help out where I can.

@dominictarr dominictarr merged commit 5e1fb0a into dominictarr:master Sep 24, 2016
@dominictarr
Copy link
Owner

awesome, you are now also a collaborator and npm owner,
merged into 1.2.1

@jcready
Copy link

jcready commented Nov 20, 2016

Can someone explain how we can use these new header/footer events to take JSON data like in #93 and pipe it to a write stream such that I can modify each object in the records array but also include the rest of the top-level properties in the final output piped to the write stream?

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants