stream-to-buf
convert stream to buffer
Last updated 8 years ago by dead_horse .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install stream-to-buf 
SYNC missed versions from official npm registry.

stream-to-buf

Collect a readable stream's data into buffer. Support max size limit.

Install

npm i stream-to-buf

Usage

const streamTobuffer = require('stream-to-buf');

const stream = fs.createReadStream(path.join(__dirname, 'fixtures/file'));
streamToBuffer(stream, { maxSize: '10kb' }).then(onBuffer, onError);

Options

  • maxSize: If stream's emitted buffer exceed maxSize, it will throw an error.(but it will still consume the stream before resolve).

Current Tags

  • 1.0.0                                ...           latest (8 years ago)

1 Versions

  • 1.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (5)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |