<commit_before># blob-to-buffer [![Build Status][travis-image]][travis-url] [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url]

#### 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' })

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

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

### license

MIT. Copyright (c) [<NAME>](http://feross.org).

[travis-image]: https://img.shields.io/travis/feross/blob-to-buffer.svg?style=flat
[travis-url]: https://travis-ci.org/feross/blob-to-buffer
[npm-image]: https://img.shields.io/npm/v/blob-to-buffer.svg?style=flat
[npm-url]: https://npmjs.org/package/blob-to-buffer
[downloads-image]: https://img.shields.io/npm/dm/blob-to-buffer.svg?style=flat
[downloads-url]: https://npmjs.org/package/blob-to-buffer<commit_msg>badge<commit_after># blob-to-buffer [![Build Status][travis-image]][travis-url] [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url]

#### 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' })

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

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

### license

MIT. Copyright (c) [<NAME>](http://feross.org).

[travis-image]: https://img.shields.io/travis/feross/blob-to-buffer/master.svg?style=flat
[travis-url]: https://travis-ci.org/feross/blob-to-buffer
[npm-image]: https://img.shields.io/npm/v/blob-to-buffer.svg?style=flat
[npm-url]: https://npmjs.org/package/blob-to-buffer
[downloads-image]: https://img.shields.io/npm/dm/blob-to-buffer.svg?style=flat
[downloads-url]: https://npmjs.org/package/blob-to-buffer
{'fraction_non_alphanumeric': 0.18766366016875183, 'fraction_numerical': 0.00523712540005819, 'mean_word_length': 4.371875, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 20, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '692669', 'n_tokens_mistral': 1264, 'n_tokens_neox': 1209, 'n_words': 291}