stream-with-known-length-to-buffer
Convert a Readable Stream with a known length into a Buffer
This package converts a Readable Stream into a Buffer, with just one Buffer allocation (excluding allocations done internally by the streams implementation).
This is lighter-weight choice than
stream-to-array
when the
total stream length is known in advance. This whole package is 15 lines.
This module is used by WebTorrent.
install
npm install stream-with-known-length-to-buffer
usage
var toBuffer =
license
MIT. Copyright (c) Feross Aboukhadijeh.