json-split-stream
A fast way to split concatenated JSON data into individual chunks.
Install:
npm install json-split-stream
const JSONSplitStream = ; const chunker = ; // is a Duplex stream chunker;chunker; // => '[1,2,3]'chunker; // => '{"a":12}'chunker; // => null
Also supports not storing the incoming data and just emitting events for JSON boundaries (counted in JS string length, not bytes):
const chunker = storeData: false ;chunker; chunker;chunker; // Prints:ended at 7ended at 15
License
MIT