response-iterator
Creates an async iterator for a variety of inputs in the browser and node. Supports fetch, node-fetch, and cross-fetch
Last updated 6 months ago by kmalakoff .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install response-iterator 
SYNC missed versions from official npm registry.

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

API Docs

Current Tags

  • 1.0.10                                ...           latest (4 months ago)

38 Versions

  • 1.0.10                                ...           4 months ago
  • 1.0.9                                ...           4 months ago
  • 1.0.8                                ...           4 months ago
  • 1.0.7                                ...           4 months ago
  • 1.0.6                                ...           4 months ago
  • 1.0.5                                ...           4 months ago
  • 1.0.4                                ...           5 months ago
  • 1.0.3                                ...           6 months ago
  • 1.0.2                                ...           6 months ago
  • 1.0.1                                ...           9 months ago
  • 1.0.0                                ...           10 months ago
  • 0.2.25                                ...           10 months ago
  • 0.2.24                                ...           10 months ago
  • 0.2.23                                ...           10 months ago
  • 0.2.22                                ...           a year ago
  • 0.2.21                                ...           a year ago
  • 0.2.20                                ...           a year ago
  • 0.2.19                                ...           a year ago
  • 0.2.18                                ...           a year ago
  • 0.2.17                                ...           a year ago
  • 0.2.16                                ...           a year ago
  • 0.2.15                                ...           a year ago
  • 0.2.14                                ...           a year ago
  • 0.2.13                                ...           a year ago
  • 0.2.11                                ...           a year ago
  • 0.2.10                                ...           a year ago
  • 0.2.9                                ...           a year ago
  • 0.2.8                                ...           a year ago
  • 0.2.7                                ...           a year ago
  • 0.2.6                                ...           4 years ago
  • 0.2.5                                ...           4 years ago
  • 0.2.4                                ...           4 years ago
  • 0.2.3                                ...           4 years ago
  • 0.2.2                                ...           4 years ago
  • 0.2.1                                ...           4 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |