# blob-to-buffer

> Convert a Blob to a Buffer

Latest version **1.2.9** (published 2020-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install blob-to-buffer
pnpm add blob-to-buffer
yarn add blob-to-buffer
bun add blob-to-buffer
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.9 |
| Published | 2020-10-27 |
| First published | 2014-10-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/blob-to-buffer) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 76 |
| Author | Feross Aboukhadijeh |
| Maintainers | feross |
| Keywords | blob, browserify, buffer, convert, filereader |

## Links

- npm: https://www.npmjs.com/package/blob-to-buffer
- Repository: https://github.com/feross/blob-to-buffer
- Issues: https://github.com/feross/blob-to-buffer/issues
- Funding: https://github.com/sponsors/feross
- npm.io page: https://npm.io/package/blob-to-buffer

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.2.9 (latest) — 2020-10-27
- 1.2.8 — 2018-06-09
- 1.2.7 — 2018-01-29
- 1.2.6 — 2016-02-12
- 1.2.5 — 2016-01-12
- 1.2.4 — 2015-12-29
- 1.2.3 — 2015-05-12
- 1.2.2 — 2015-05-12
- 1.2.1 — 2015-05-04
- 1.2.0 — 2014-12-30
- 1.1.0 — 2014-10-22
- 1.0.3 — 2014-10-20
- 1.0.2 — 2014-10-20
- 1.0.1 — 2014-10-20
- 1.0.0 — 2014-10-20

## README

# blob-to-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

[travis-image]: https://img.shields.io/travis/feross/blob-to-buffer/master.svg
[travis-url]: https://travis-ci.org/feross/blob-to-buffer
[npm-image]: https://img.shields.io/npm/v/blob-to-buffer.svg
[npm-url]: https://npmjs.org/package/blob-to-buffer
[downloads-image]: https://img.shields.io/npm/dm/blob-to-buffer.svg
[downloads-url]: https://npmjs.org/package/blob-to-buffer
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com

#### Convert a Blob to a [Buffer](https://github.com/feross/buffer).

[![Sauce Test Status](https://saucelabs.com/browser-matrix/blob-to-buffer.svg)](https://saucelabs.com/u/blob-to-buffer)

Say you're using the ['buffer'](https://github.com/feross/buffer) module on npm, or
[browserify](http://browserify.org/) and you're working with lots of binary data.

Unfortunately, sometimes the browser or someone else's API gives you a `Blob`. Silly
browser. How do you convert it to a `Buffer`?

Something with a goofy `FileReader` thingy... Time to Google for it yet again... There must be a better way!

***There is! Simply use this module!***

Works in the browser. This module is used by [WebTorrent](http://webtorrent.io)!

### install

```
npm install blob-to-buffer
```

### usage

```js
var toBuffer = require('blob-to-buffer')

// Get a Blob somehow...
var blob = new Blob([ new Uint8Array([1, 2, 3]) ], { type: 'application/octet-binary' })

toBuffer(blob, function (err, buffer) {
  if (err) throw err

  buffer[0] // => 1
  buffer.readUInt8(1) // => 2
})
```

### license

MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).

---
_Source: https://npm.io/package/blob-to-buffer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
