Files: 1792ff4568516f8d685178c705a4d9d687d87368 / README.md
1456 bytesRaw
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 = require('buffer-pipe')
const p = new Pipe()
p.write(Buffer.from([1,2,3,4]))
const buf = p.read(2)
// <1, 2>
API
constructor
Creates a new instance of a pipe
Parameters
buf
Buffer an 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
LICENSE
Built with git-ssb-web