Skip to content

feross/stream-to-blob

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

var toBlob = require('stream-to-blob')

toBlob(fs.createReadStream('file.txt'), function (err, blob) {
  if (err) return console.error(err.message)
  console.log(blob)
})

api

toBlob(stream, [mimeType], callback)

Convert the Readable stream into a W3C Blob, optionally, with the given mimeType. The callback will be called with two arguments:

  • An Error object, or null
  • A Blob object

license

MIT. Copyright (c) Feross Aboukhadijeh.

About

Convert a Readable Stream to a Blob

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 3

  •  
  •  
  •