0.2.20 • Published 5 months ago
response-iterator v0.2.20
response-iterator
Creates an async iterator for a variety of inputs in the browser and node. Supports fetch, node-fetch, cross-fetch, axios, got, undici.
Example 1
// import "isomorphic-fetch"; // node only
import responseIterator from 'response-iterator';
const res = await fetch('https://raw.githubusercontent.com/kmalakoff/response-iterator/master/package.json');
let data = '';
for await (const chunk of responseIterator(res)) {
data += chunk;
}
console.log(JSON.parse(data).name); // "response-iterator"
Example 2
import crossFetch from 'cross-fetch';
import responseIterator from 'response-iterator';
const res = await crossFetch('https://raw.githubusercontent.com/kmalakoff/response-iterator/master/package.json');
let data = '';
for await (const chunk of responseIterator(res)) {
data += chunk;
}
console.log(JSON.parse(data).name); // "response-iterator"
Documentation
0.2.16
5 months ago
0.2.15
5 months ago
0.2.14
5 months ago
0.2.13
5 months ago
0.2.11
5 months ago
0.2.10
5 months ago
0.2.20
5 months ago
0.2.19
5 months ago
0.2.18
5 months ago
0.2.17
5 months ago
0.2.7
5 months ago
0.2.9
5 months ago
0.2.8
5 months ago
0.2.6
3 years ago
0.2.3
3 years ago
0.2.5
3 years ago
0.2.4
3 years ago
0.2.2
4 years ago
0.2.1
4 years ago
0.2.0
4 years ago
0.1.1
4 years ago
0.1.0
4 years ago