This package converts a Readable Stream into a Blob URL.
This package is used by WebTorrent.
npm install stream-to-blob-url
const toBlobURL = require('stream-to-blob-url')
const fs = require('fs')
const blobUrl = await toBlobURL(fs.createReadStream('file.txt'))
console.log(url)
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
.
MIT. Copyright (c) Feross Aboukhadijeh.