from2-blob
Create a readable stream from a Blob or a File with from2
Last updated 3 years ago by goto-bus-stop .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install from2-blob 
SYNC missed versions from official npm registry.

from2-blob

Create a readable stream from a Blob with from2.

Install

npm install from2-blob

Usage

var fromBlob = require('from2-blob')
var toBlob = require('stream-to-blob')
var zlib = require('zlib')

fileInput.onchange = function () {
  var stream = fromBlob(fileInput.files[0])
    .pipe(zlib.createDeflate())
  toBlob(stream, function (err, blob) {
    if (err) throw err
    window.open( URL.createObjectURL(blob) )
  })
}

API

fromBlob(blob: Blob): Readable

Create a readable stream that will stream appropriately sized chunks of the given Blob.

Related

  • from2 - Convenience wrapper for ReadableStream, with an API lifted from "from" and "through2"
  • from2-array - Create a from2 stream based on an array of source values
  • from2-buffer - Create a readable stream from a Buffer with from2
  • from2-string - Create a stream from a string. Sugary wrapper around from2

License

MIT

Current Tags

  • 1.0.1                                ...           latest (3 years ago)

2 Versions

  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 5
Dependencies (2)
Dev Dependencies (6)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |