discrete-stream
discrete-stream
ensures that the chunks you put in on one end will come out in the same size on the other side.
Example
Node 1
var en = discreteenen
Node 2
var de = discretesocketde
Install
$ npm install discrete-stream
API
discrete.Encoder(options)
discrete.Decoder(options)
Inherits from transform stream.
The encoder transforms an input stream to the discrete
protocol.
The decoder transforms a discrete
stream back to correctly sliced buffers.
options
(object)
prefixBytes
How many bytes the size prefix header should use. Defaults to4
prefixEndian
If we should use big or little endians. Defaults to big endians.- Other options in transform stream
License
MIT