Closed chriszrc closed 5 years ago
trying to do almost the same with mongoose,
stream.pipe(JSONStream.stringify()).pipe(json2CsvParser).pipe(writer);
but in my case stream will return JS object so first I need to convert it to JSON, but code above gives me error: SyntaxError: Unexpected end of JSON input
Give the 4.0-alpha a try here https://github.com/zemirco/json2csv it now includes stream support.
This library will be deprecated.
works, thanks
https://github.com/zemirco/json2csv now has a streams API, please use that module as this one is deprecated/unmaintained.
I'm streaming json data from postgres to csv files. Currently, it seems I have to do this:
That is, even though I already have valid json objects, I have to first stringify it, then convert to csv. Is this really the right way to achieve this streaming transformation? Can json2csv-stream accept json rather than a string?