git ssb

0+

wanderer🌟 / buffer-pipe



Tree: bb08ba7fabe618c5ba831430d5478efdb59be6e5

Files: bb08ba7fabe618c5ba831430d5478efdb59be6e5 / README.md

2152 bytesRaw

SYNOPSIS

NPM Package
Build Status
Coverage Status

js-standard-style

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

index.js:8-10

Creates a new instance of a pipe

Parameters

read

index.js:17-21

read num number of bytes from the pipe

Parameters

Returns Buffer

write

index.js:27-30

Wites a buffer to the pipe

Parameters

end

index.js:36-38

Whether or not there is more data to read from the buffer returns {Boolean}

LICENSE

MPL-2.0

Built with git-ssb-web