bf

binary-fetch

Fetch incremental binary packets from a browser

Showing:

Popularity

Downloads/wk

35

Maintenance

No Maintenance Data Available

Package

Dependencies

3

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

binary-fetch Beta

Fetch incremental binary packets from a browser

Currently, the only way to access the progress from a request or upload in a browser is with the XMLHttpRequest API. However, the the progress data from the XMLHttpRequest API does not give you access to the actual binary data that has been recieved.

Binary fetch solves this problem by giving you immediate access to the binary data while it is being recieved.

Binary fetch is loosely based on the JavaScript fetch API.

npm install --save binary-fetch
import binaryFetch from 'binary-fetch';

binaryFetch('http://example.com/file.binary', {
  method: 'GET'
}, (res) => { // fires 1 or more times during request
  return res.arrayBuffer().then((body) => {
    console.log('binary data recieved so far =>');
    console.log(body);
  });
}).then((res) => { // fires when request is finished
  return res.arrayBuffer().then((body) => {
    console.log('all binary data recieved =>');
    console.log(body);
  });
});

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial