Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afeiship/next-arraybuffer2blob
Arraybuffer to blob.
https://github.com/afeiship/next-arraybuffer2blob
array b64 base64 blob buffer image next url
Last synced: 24 days ago
JSON representation
Arraybuffer to blob.
- Host: GitHub
- URL: https://github.com/afeiship/next-arraybuffer2blob
- Owner: afeiship
- License: mit
- Created: 2021-07-08T15:54:44.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-07-08T15:59:21.000Z (over 3 years ago)
- Last Synced: 2024-10-06T22:25:47.299Z (about 1 month ago)
- Topics: array, b64, base64, blob, buffer, image, next, url
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# next-arraybuffer2blob
> Arraybuffer to blob.[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```bash
npm install -S @jswork/next-arraybuffer2blob
```## usage
```js
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](https://github.com/afeiship/next-arraybuffer2blob/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/next-arraybuffer2blob
[version-url]: https://npmjs.org/package/@jswork/next-arraybuffer2blob[license-image]: https://img.shields.io/npm/l/@jswork/next-arraybuffer2blob
[license-url]: https://github.com/afeiship/next-arraybuffer2blob/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-arraybuffer2blob
[size-url]: https://github.com/afeiship/next-arraybuffer2blob/blob/master/dist/next-arraybuffer2blob.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/next-arraybuffer2blob
[download-url]: https://www.npmjs.com/package/@jswork/next-arraybuffer2blob