stream-to-blob-url

v3.0.2
Convert a Readable Stream to a Blob URL
stream buffer convert stream to blob url blob url convert length name

stream-to-blob-url travis npm downloads javascript style guide

Convert a Readable Stream to a Blob URL

Sauce Test Status

This package converts a Readable Stream into a Blob URL.

This package is used by WebTorrent.

install

npm install stream-to-blob-url

usage

const toBlobURL = require('stream-to-blob-url')
const fs = require('fs')

const blobUrl = await toBlobURL(fs.createReadStream('file.txt'))
console.log(url)

api

promise = toBlobURL(stream, [mimeType], callback)

Convert the Readable stream into a W3C Blob URL (blob:...), optionally, with the given mimeType.

Returns a Promise which resolves to a string on success. Otherwise, rejects with an Error.

license

MIT. Copyright (c) Feross Aboukhadijeh.

npm i stream-to-blob-url

Metadata

  • MIT
  • Whatever
  • Feross Aboukhadijeh
  • released 5/10/2020

Downloads

Maintainers