JSPM

stream-to-blob

2.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6122
  • Score
    100M100P100Q122633F
  • License MIT

Convert a Readable Stream to a Blob

Package Exports

  • stream-to-blob

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (stream-to-blob) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.