stream-to-blob
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/stream-to-blob package

2.0.1 • Public • Published

stream-to-blob travis npm downloads javascript style guide

Convert a Readable Stream to a Blob

Sauce Test Status

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.

Package Sidebar

Install

npm i stream-to-blob

Weekly Downloads

6,397

Version

2.0.1

License

MIT

Unpacked Size

4.59 kB

Total Files

4

Last publish

Collaborators

  • feross