1.0.0 • Published 3 years ago

@jswork/next-arraybuffer2url v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

next-arraybuffer2url

Array buffer to blob url.

version license size download

installation

npm install -S @jswork/next-arraybuffer2url

usage

import '@jswork/next-arraybuffer2url';

const xhrOverride = new XMLHttpRequest();
xhrOverride.responseType = 'arraybuffer';
$.ajax({
  url: '/url/of/your/binary/data',
  method: 'GET',
  xhr: function() {
      return xhrOverride;
  }
}).then(function (responseData) {
  const url = nx.arraybuffer2url(responseData);

  // <img src={url} />
});

license

Code released under the MIT license.