stream-to-blob
v1.0.2 stream buffer convert stream to blob blob convert length name
stream-to-blob
Convert a Readable Stream to a Blob
This package converts a Readable Stream into a Blob.
This package is used by WebTorrent.
install
npm install stream-to-blob
usage
const streamToBlob = require('stream-to-blob')
const stream = new stream.Readable() // any Node.js readable stream
const blob = await streamToBlob(stream)
api
promise = streamToBlob(stream, [mimeType])
Convert the given readable stream, stream
, into a W3C Blob
. If mimeType
is provided, then the Blob
will have its mime type set to that value.
Returns a Promise
which resolves to a Blob
object on success. Otherwise, rejects with an Error
.
license
MIT. Copyright (c) Feross Aboukhadijeh.
npm i [email protected]
Metadata
- MIT
- Whatever
- Feross Aboukhadijeh
- released 6/28/2019