0.2.2 • Published 4 years ago
json-length-delimited-stream v0.2.2
JSONLengthDelimitedStream 
Wraps a TCP Socket with a length-delimited JSON frame as a readable stream.
Usage
const jsonLengthDelimitedStream = new JSONLengthDelimitedStream(tcpSocket, { frameLengthInBytes: 4 });
jsonLengthDelimitedStream.on('data', (object) => {
/// do whatever you will with the object!
});
jsonLengthDelimitedStream.on('end', () => {
// the socket has closed!
});