kaue / jsonexport

{} → :page_facing_up: it's easy to convert JSON to CSV
http://kaue.github.io/jsonexport/
Apache License 2.0
247 stars 41 forks source link

Add support for objectMode streaming #82

Open air2 opened 4 years ago

air2 commented 4 years ago

Status

READY

Description

This commit supports streaming objects, instead of stringified JSON, by adding objectMode to the options and implementing it in the stream.js

Related PRs

List related PRs against other branches:

branch PR
other_pr_production [link]()
other_pr_master [link]()

Todos

Steps to Test or Reproduce

Outline the steps to test or reproduce the PR here.

git pull --prune
git checkout <feature_branch>
bundle; script/server

Impacted Areas in Application

List general components of the application that this PR will affect:

AckerApple commented 4 years ago

I have reviewed some of the code here. I haven’t had too much experience in our jsonexport in regards to streaming. However, what I think I am reading here sounds amazing.

@air2 could you please elaborate how this works, if I understand correctly we can now stream, with your code, in chunks of valid json-to-object... If you could elaborate please. I am a contributor and could help along if I also better understood a better picture here please and thank you

AckerApple commented 4 years ago

Also it would help me if you were able to provide a unit test in any fashion to accompany this PR