Skip to content

make buffers into something you can slice bytes off at will, for when a stream is too much.

Notifications You must be signed in to change notification settings

nathan7/readable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

readable

make buffers into something you can slice bytes off at will, for when a stream is too much.

Installation

npm install readable

API

Readable(buf) → function read(n)

Creates your readable. Will cast buf to a Buffer.

read(n) → Buffer

Slices the first n bytes off, and hand them to you. If there aren't enough bytes left, we'll throw an error.

read(-1) → UInt8

Slices the first byte off, and hands it straight to you, no Buffer wrapping. Sugar for read(1)[0].

read.able

Amount of bytes left in the buffer.

read.push(chunk)

Push another chunk onto your buffer. Will cast chunk to a Buffer.

About

make buffers into something you can slice bytes off at will, for when a stream is too much.

Resources

Stars

Watchers

Forks

Packages

No packages published