Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

buffer-pipe

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buffer-pipe

A simple pipe for buffers

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
35K
decreased by-22.42%
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 20 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc