I am looking for a solution which could be piped to my existing streams so that this input:
{ "foo":"bar" }{ "foo": { "foo": "bar" }}
Would display this:
{ "foo":"bar" }
{ "foo": { "foo": "bar" }}
Using this code:
incomingStream.pipe(jsonSplitter()).on('data', (singleJson) => {
console.log(singleJson)
});
Any packages?
Ok so you can use
stream-json
npm package. In order to achieve what I asked in the question you would need this code: