JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 31431
  • Score
    100M100P100Q141512F
  • License MPL-2.0

A simple pipe for buffers

Package Exports

  • buffer-pipe

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (buffer-pipe) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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-12

Creates a new instance of a pipe

Parameters

  • buf Buffer an optional buffer to start with (optional, default Buffer.from([]))

read

index.js:19-24

read num number of bytes from the pipe

Parameters

Returns Buffer

write

index.js:30-34

Wites a buffer to the pipe

Parameters

end

index.js:40-42

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

bytesRead

index.js:48-50

returns the number of bytes read from the stream

Returns Integer

bytesWrote

index.js:56-58

returns the number of bytes wrote to the stream

Returns Integer

LICENSE

MPL-2.0