@jswork/next-arraybuffer2blob

1.0.0 • Public • Published

next-arraybuffer2blob

Arraybuffer to blob.

version license size download

installation

npm install -S @jswork/next-arraybuffer2blob

usage

import '@jswork/next-arraybuffer2blob';

socket.onmessage = function(msg) {
  var arrayBuffer = msg.data;
  var blob = nx.arraybuffer2blob(arrayBuffer);
  var image = document.getElementById('image');
  var reader = new FileReader();
  reader.onload = function(e) {
    // base64
    image.src = e.target.result;
  };
  reader.readAsDataURL(blob);
};

license

Code released under the MIT license.

Dependencies (0)

    Dev Dependencies (19)

    Package Sidebar

    Install

    npm i @jswork/next-arraybuffer2blob

    Weekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    4.95 kB

    Total Files

    5

    Last publish

    Collaborators

    • afeiship