readable
make buffers into something you can slice bytes off at will, for when a stream is too much.
Last updated 12 years ago by nathan7 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install readable 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 1.1.3                                ...           latest (12 years ago)

5 Versions

  • 1.1.3                                ...           12 years ago
  • 1.1.2                                ...           13 years ago
  • 1.1.1                                ...           13 years ago
  • 1.1.0                                ...           13 years ago
  • 1.0.0                                ...           13 years ago
Maintainers (1)
Downloads
Total 23
Today 0
This Week 4
This Month 9
Last Day 0
Last Week 3
Last Month 7
Dependencies (0)
None
Dev Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE