json-doc-stream
Parse streams of JSON documents.
A simple wrapper for jsonparse
to efficiently parse a stream of multple JSON documents emitting events as each document completes containing the parsed data. This library handles most corner cases involved in streaming JSON documents over multiple lines. However if you have simple uses cases and can stream JSON documents as single lines then you may get more mileage out of simple-json-doc-stream
.
Install
npm install json-doc-stream
Usage
const JSONDocStream = ; const stream = ; stream; stream; stream; // or readableStream;