json-length-delimited-stream

0.2.2 • Public • Published

JSONLengthDelimitedStream Build Status

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!
});

Readme

Keywords

none

Package Sidebar

Install

npm i json-length-delimited-stream

Weekly Downloads

1

Version

0.2.2

License

MIT

Unpacked Size

8.98 kB

Total Files

6

Last publish

Collaborators

  • implausibility
  • gk-dev