stream-to-blob-url
Convert a Readable Stream to a Blob URL
This package converts a Readable Stream into a Blob URL.
This package is used by WebTorrent.
install
npm install stream-to-blob-url
usage
var toBlobURL = require('stream-to-blob-url')
toBlobURL(fs.createReadStream('file.txt'), function (err, url) {
if (err) return console.error(err.message)
console.log(url)
})
api
toBlobURL(stream, [mimeType], callback)
Convert the Readable stream
into a W3C Blob
URL, optionally, with the given
mimeType
. The callback
will be called with two arguments:
- An
Error
object, or null
- A
string
blob url (blob:...
)
license
MIT. Copyright (c) Feross Aboukhadijeh.