{"_id":"response-iterator@1.0.14","bugs":{"url":"https://github.com/kmalakoff/response-iterator/issues"},"dist":{"shasum":"c8160c84678b296c4d2ef5cba3fec04987101d80","tarball":"http://registry-npm.ywwl.com/response-iterator/download/response-iterator-1.0.14.tgz","fileCount":44,"integrity":"sha512-QvNvNBVi3dviUeGr4Rk5aviK/UbuSOQB0qRUaZxHTi+kl+wIfGPMkNDJam90qcHBVJaWVMvnI5wxoX+jsvqDvw==","signatures":[{"sig":"MEUCIQCYjTjf2eRHqwi9cYCk7WS7QMXet/CNuJgfJLlrcNJ62wIgagG5bf7rDirmDiX0qiyaQ1Yu+9UyU7epISLb9lws32E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDIOIWRi2FAatw9zdLqiuAux71NCrp61NbbZzu5hlnNIQIgJfrKdPqgjOXCCYboQVjQIVMLuXUN1a5zdLj1XPyL3EE="}],"unpackedSize":74552,"size":11633,"noattachment":false,"key":"/response-iterator/-/response-iterator-1.0.14.tgz"},"main":"dist/cjs/index.js","name":"response-iterator","tsds":{"targets":["cjs","esm","umd"]},"type":"module","types":"dist/cjs/index.d.ts","author":{"url":"https://github.com/kmalakoff","name":"Kevin Malakoff","email":"kmalakoff@gmail.com"},"source":"src/index.ts","engines":{"node":">=0.8"},"exports":{".":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"./umd":"./dist/umd/response-iterator.cjs","./package.json":"./package.json"},"gitHead":"7fc8ab7e8677575a51cd056cb33e32e39d54b76d","license":"MIT","scripts":{"docs":"tsds docs","test":"tsds test:browser --config wtr.config.mjs && tsds test:browser --config wtr.config.mjs \"test/**/*.test-browser.*\" && tsds test:node --no-timeouts \"test/**/*.test.*\" && tsds test:node --no-timeouts \"test/**/*.test-node.*\"","build":"tsds build","format":"tsds format","version":"tsds version","test:engines":"tsds test:browser --config wtr.config.mjs && tsds test:browser --config wtr.config.mjs \"test/**/*.test-browser.*\" && nvu engines tsds test:node --no-timeouts \"test/**/*.test.*\" \"test/unit/index.test-node.ts\" && tsds test:node --no-timeouts \"test/integration/node-adapters.test-node.ts\"","prepublishOnly":"tsds validate"},"version":"1.0.14","_npmUser":{"name":"kmalakoff","email":"kmalakoff@gmail.com"},"homepage":"https://github.com/kmalakoff/response-iterator#README.md","keywords":["Symbol","Symbol.asyncIterator","array","arrayBuffer","asyncIterator","axios","blob","body","browser","cross-fetch","fetch","got","isomorphic-fetch","iteration","iterator","node","node-fetch","response","stream","typescript","undici"],"repository":{"url":"git+ssh://git@github.com/kmalakoff/response-iterator.git","type":"git"},"_npmVersion":"11.20.0","description":"Creates an async iterator for a variety of inputs in the browser and node. Supports fetch, node-fetch, and cross-fetch","directories":{},"maintainers":[{"name":"kmalakoff","email":"kmalakoff@gmail.com"}],"_nodeVersion":"26.11.1","allowScripts":{"esbuild":true},"_hasShrinkwrap":false,"devDependencies":{"axios":"^1.13.2","undici":"^8.3.0","get-remote":"^2.3.4","node-fetch":"^3.3.2","@types/node":"*","cross-fetch":"^4.1.0","tsds-config":"*","@types/mocha":"*","ts-dev-stack":"*","pinkie-promise":"*","readable-stream":"2.3.8","isomorphic-fetch":"^3.0.0","node-version-use":"*","tsds-web-test-runner":"*","@types/isomorphic-fetch":"^0.0.39","@web/dev-server-import-maps":"^0.3.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/response-iterator_1.0.14_1791783896475_0.848270887154704"},"readme":"# response-iterator\n\nCreate an async iterator for response bodies from Fetch, node-fetch, cross-fetch, Axios, or Node streams.\n\n## Install\n\n```sh\nnpm install response-iterator\n```\n\n## Use with fetch\n\n```typescript\nimport responseIterator from 'response-iterator';\n\nconst res = await fetch('https://raw.githubusercontent.com/kmalakoff/response-iterator/master/package.json');\n\nconst decoder = new TextDecoder();\nlet data = '';\nfor await (const chunk of responseIterator(res)) {\n  data += typeof chunk === 'string' ? chunk : decoder.decode(chunk, { stream: true });\n}\ndata += decoder.decode();\nconsole.log(JSON.parse(data).name); // \"response-iterator\"\n```\n\nThe example uses the global `fetch` available in modern Node.js and browsers. On older Node.js versions, pass a response from a fetch implementation such as `cross-fetch`. Yielded chunks keep the underlying body type, so decode `Uint8Array` chunks before treating them as text.\n\n## Documentation\n\n[API Docs](https://kmalakoff.github.io/response-iterator/)\n","publish_time":1791783896571,"_cnpm_publish_time":1791783896571,"dist-tags":{"latest":"1.0.14"}}