Skip to content

Wraps a TCP Socket with a length-delimited JSON frame as a readable stream.

License

Notifications You must be signed in to change notification settings

Axosoft/json-length-delimited-stream-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Wraps a TCP Socket with a length-delimited JSON frame as a readable stream.

Resources

License

Stars

Watchers

Forks

Packages

No packages published