This package converts a Readable Stream into a Blob.
This package is used by WebTorrent.
npm install stream-to-blob
var toBlob = require('stream-to-blob')
toBlob(fs.createReadStream('file.txt'), function (err, blob) {
if (err) return console.error(err.message)
console.log(blob)
})
Convert the Readable stream
into a W3C Blob
, optionally, with the given
mimeType
. The callback
will be called with two arguments:
- An
Error
object, ornull
- A
Blob
object
MIT. Copyright (c) Feross Aboukhadijeh.