blob-to-buffer

WebJar for blob-to-buffer

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

blob-to-buffer
Last Version

Last Version

1.2.8
Release Date

Release Date

Type

Type

jar
Description

Description

blob-to-buffer
WebJar for blob-to-buffer
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/feross/blob-to-buffer

Download blob-to-buffer

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/blob-to-buffer/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>blob-to-buffer</artifactId>
    <version>1.2.8</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/blob-to-buffer/
implementation 'org.webjars.npm:blob-to-buffer:1.2.8'
// https://jarcasting.com/artifacts/org.webjars.npm/blob-to-buffer/
implementation ("org.webjars.npm:blob-to-buffer:1.2.8")
'org.webjars.npm:blob-to-buffer:jar:1.2.8'
<dependency org="org.webjars.npm" name="blob-to-buffer" rev="1.2.8">
  <artifact name="blob-to-buffer" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='blob-to-buffer', version='1.2.8')
)
libraryDependencies += "org.webjars.npm" % "blob-to-buffer" % "1.2.8"
[org.webjars.npm/blob-to-buffer "1.2.8"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

blob-to-buffer travis npm downloads javascript style guide

Convert a Blob to a Buffer.

Sauce Test Status

Say you're using the 'buffer' module on npm, or browserify 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!

install

npm install blob-to-buffer

usage

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.

Versions

Version
1.2.8
1.2.7
1.2.6