SYNOPSIS
A simple pipe for buffers. Write data to one end and read data off the other end.
INSTALL
npm install buffer-pipe
USAGE
const pipe = const p = pconst buf = p // <1, 2>
API
constructor
Creates a new instance of a pipe
Parameters
buf
Buffer an optional buffer to start with (optional, defaultBuffer.from([])
)
read
read num
number of bytes from the pipe
Parameters
num
Number
Returns Buffer
write
Wites a buffer to the pipe
Parameters
buf
Buffer
end
Whether or not there is more data to read from the buffer returns {Boolean}
bytesRead
returns the number of bytes read from the stream
Returns Integer
bytesWrote
returns the number of bytes wrote to the stream
Returns Integer