0.0.46 • Published 7 years ago

binary-fetch v0.0.46

Weekly downloads
6
License
MIT
Repository
-
Last release
7 years ago

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);
  });
});
0.0.46

7 years ago

0.0.45

7 years ago

0.0.44

7 years ago

0.0.43

7 years ago

0.0.42

7 years ago

0.0.41

7 years ago

0.0.40

7 years ago

0.0.39

7 years ago

0.0.38

7 years ago

0.0.22

7 years ago

0.0.21

7 years ago

0.0.20

7 years ago

0.0.19

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago