chunk2json
JSON parser that extracts JSON objects out of a byte stream without the use of delimeters.
Ideal for extracting JSON objects out of an incoming TCP socket byte stream.
Install
Install with npm:
$ npm install chunk2json
Use
const ChunkParser = ;const parser = ; parser; parser;parser;parser;parser;parser;parser;
The parser consumes buffers which can contain partial and/or complete JSON chunks. When a complete JSON object is identified the on("json")
event callback is invoked with the corresponding JSON object(in buffer form).
Test
Run the tests
$ npm test
License
Copyright (c) 2016 Ioannis Tzanellis
Released under the MIT license