{"_id":"@webreflection/fetch","_rev":"8-06907f1373412070bbb7ba6f6da580e4","name":"@webreflection/fetch","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.0":{"name":"@webreflection/fetch","version":"0.0.0","keywords":["fetch","response","merged"],"author":{"name":"Andrea Giammarchi"},"license":"MIT","_id":"@webreflection/fetch@0.0.0","maintainers":[{"name":"webreflection","email":"andrea.giammarchi@gmail.com"}],"dist":{"shasum":"a89b3cba2cece99647150be6fd904762776ea813","tarball":"https://registry.npmjs.org/@webreflection/fetch/-/fetch-0.0.0.tgz","fileCount":7,"integrity":"sha512-zAy4lgxJzpEsdc2Hxjqg/hsfTzY7lDDCWJapAgEgiIiQVhxO+W7nkag+dx8BLSwbsQ8SunHT3mYWXb76yS2zWw==","signatures":[{"sig":"MEUCIG3a/Zo0wbYBPvQ8yWshEtUkmIFgGbA79D99H6T/ptybAiEAzwnIlIj74kr9zQiKf8S+vt3nT3/bv4K6ydcF/w3OVBQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4141},"main":"./cjs/index.js","type":"module","unpkg":"es.js","module":"./esm/index.js","exports":{".":{"import":"./esm/index.js","default":"./cjs/index.js"},"./package.json":"./package.json"},"gitHead":"47a72b6b328ddf0946f5dc31ee46695f9343f7a8","scripts":{"cjs":"ascjs --no-default esm cjs","test":"c8 node test/index.js","build":"npm run cjs && npm run rollup:es && npm run test","coveralls":"c8 report --reporter=text-lcov | coveralls","rollup:es":"rollup --config rollup/es.config.js"},"_npmUser":{"name":"webreflection","email":"andrea.giammarchi@gmail.com"},"_npmVersion":"10.4.0","description":"A fetch with Response abilities.","directories":{},"_nodeVersion":"21.6.1","_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","ascjs":"^6.0.3","rollup":"^4.10.0","coveralls":"^3.1.1","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-node-resolve":"^15.2.3"},"_npmOperationalInternal":{"tmp":"tmp/fetch_0.0.0_1707929068219_0.9010126621335508","host":"s3://npm-registry-packages"}},"0.1.0":{"name":"@webreflection/fetch","version":"0.1.0","keywords":["fetch","response","merged"],"author":{"name":"Andrea Giammarchi"},"license":"MIT","_id":"@webreflection/fetch@0.1.0","maintainers":[{"name":"webreflection","email":"andrea.giammarchi@gmail.com"}],"homepage":"https://github.com/WebReflection/fetch#readme","bugs":{"url":"https://github.com/WebReflection/fetch/issues"},"dist":{"shasum":"3584d4688b30c1e5dd8af51c4e3cb04e1c45c2a0","tarball":"https://registry.npmjs.org/@webreflection/fetch/-/fetch-0.1.0.tgz","fileCount":8,"integrity":"sha512-volu0wMuTXwO8i7cdN1gW8xAwMQQ/MyOmHCqMpcyRfGDnVj/CI1hSzUY6EYoh4kpBCtcjumC4klUS5n0zDAhOw==","signatures":[{"sig":"MEUCIA7G9SbnYeW5GBJgZDpBI+VMr/brbZYRIUKyr4QakfY7AiEAznf7yXKBhmJbpdiPWkPjCKS/QKuK9nv3Jzf6Qx5mWao=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4636},"main":"./cjs/index.js","type":"module","unpkg":"es.js","module":"./esm/index.js","exports":{".":{"types":"./types/index.d.ts","import":"./esm/index.js","default":"./cjs/index.js"},"./package.json":"./package.json"},"gitHead":"47dff1f6254e26a4a4182601d4a91c37738eeb03","scripts":{"ts":"tsc -p .","cjs":"ascjs --no-default esm cjs","test":"c8 node test/index.js","build":"npm run cjs && npm run rollup:es && npm run ts && npm run test","coverage":"mkdir -p ./coverage; c8 report --reporter=text-lcov > ./coverage/lcov.info","rollup:es":"rollup --config rollup/es.config.js"},"_npmUser":{"name":"webreflection","email":"andrea.giammarchi@gmail.com"},"repository":{"url":"git+https://github.com/WebReflection/fetch.git","type":"git"},"_npmVersion":"10.4.0","description":"A fetch with Response abilities.","directories":{},"_nodeVersion":"21.6.1","_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","ascjs":"^6.0.3","rollup":"^4.10.0","typescript":"^5.3.3","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-node-resolve":"^15.2.3"},"_npmOperationalInternal":{"tmp":"tmp/fetch_0.1.0_1707929255568_0.6716090182134697","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@webreflection/fetch","version":"0.1.1","keywords":["fetch","response","merged"],"author":{"name":"Andrea Giammarchi"},"license":"MIT","_id":"@webreflection/fetch@0.1.1","maintainers":[{"name":"webreflection","email":"andrea.giammarchi@gmail.com"}],"homepage":"https://github.com/WebReflection/fetch#readme","bugs":{"url":"https://github.com/WebReflection/fetch/issues"},"dist":{"shasum":"105e005d36ea6d943a10bee5607a09148b0f9f8d","tarball":"https://registry.npmjs.org/@webreflection/fetch/-/fetch-0.1.1.tgz","fileCount":8,"integrity":"sha512-kMw09Tq1/eJYMQM0Zie3wzHEMRrYuqoM4nrOai9jMjjW6bsSSdD47VIxx58j1XDWlHCbwKzT9z+er9qUjukO9g==","signatures":[{"sig":"MEUCIBHCHuM+YzpNY57X5skWud0ifH5lMpw1L++1Yg0AKtvDAiEAlb9wCB1NZIFNH9M4T3rQV1TNXi7sbccd01ULE2U+QY0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4798},"main":"./cjs/index.js","type":"module","unpkg":"es.js","module":"./esm/index.js","exports":{".":{"types":"./types/index.d.ts","import":"./esm/index.js","default":"./cjs/index.js"},"./package.json":"./package.json"},"gitHead":"062a034edf52fb3fbe368d85680e5446bf544df9","scripts":{"ts":"tsc -p .","cjs":"ascjs --no-default esm cjs","test":"c8 node test/index.js","build":"npm run cjs && npm run rollup:es && npm run ts && npm run test","coverage":"mkdir -p ./coverage; c8 report --reporter=text-lcov > ./coverage/lcov.info","rollup:es":"rollup --config rollup/es.config.js"},"_npmUser":{"name":"webreflection","email":"andrea.giammarchi@gmail.com"},"repository":{"url":"git+https://github.com/WebReflection/fetch.git","type":"git"},"_npmVersion":"10.4.0","description":"A fetch with Response abilities.","directories":{},"_nodeVersion":"21.6.1","_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","ascjs":"^6.0.3","rollup":"^4.10.0","typescript":"^5.3.3","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-node-resolve":"^15.2.3"},"_npmOperationalInternal":{"tmp":"tmp/fetch_0.1.1_1707929315805_0.7351417805730043","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"@webreflection/fetch","version":"0.1.2","keywords":["fetch","response","merged"],"author":{"name":"Andrea Giammarchi"},"license":"MIT","_id":"@webreflection/fetch@0.1.2","maintainers":[{"name":"webreflection","email":"andrea.giammarchi@gmail.com"}],"homepage":"https://github.com/WebReflection/fetch#readme","bugs":{"url":"https://github.com/WebReflection/fetch/issues"},"dist":{"shasum":"ccc2f9da7fca19c9bad62300a7490cb04e971d6a","tarball":"https://registry.npmjs.org/@webreflection/fetch/-/fetch-0.1.2.tgz","fileCount":8,"integrity":"sha512-DKTXebbr3pa7nU49jzKiPvoNDgJlq4dg31Vq3V/piVDTrcVxSUQbDkYasflhRl4myj2eEh7wPoGaXDsIl928Zw==","signatures":[{"sig":"MEQCIGPDWBMWeEBfHXVRuEoJmJfeGRX8FGZnyVXRTZEERtCmAiALdN7Xa5AtOUX6xhgonCJE0icrbn6hXSGbuArQ/KlbZg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4919},"main":"./cjs/index.js","type":"module","unpkg":"es.js","module":"./esm/index.js","exports":{".":{"types":"./types/index.d.ts","import":"./esm/index.js","default":"./cjs/index.js"},"./package.json":"./package.json"},"gitHead":"d2eb05dcc218e1a92e8effe037dae430bccf0295","scripts":{"ts":"tsc -p .","cjs":"ascjs --no-default esm cjs","test":"c8 node test/index.js","build":"npm run cjs && npm run rollup:es && npm run ts && npm run test","coverage":"mkdir -p ./coverage; c8 report --reporter=text-lcov > ./coverage/lcov.info","rollup:es":"rollup --config rollup/es.config.js"},"_npmUser":{"name":"webreflection","email":"andrea.giammarchi@gmail.com"},"repository":{"url":"git+https://github.com/WebReflection/fetch.git","type":"git"},"_npmVersion":"10.4.0","description":"A fetch with Response abilities.","directories":{},"_nodeVersion":"21.6.1","_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","ascjs":"^6.0.3","rollup":"^4.10.0","typescript":"^5.3.3","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-node-resolve":"^15.2.3"},"_npmOperationalInternal":{"tmp":"tmp/fetch_0.1.2_1707940553000_0.184070534226781","host":"s3://npm-registry-packages"}},"0.1.3":{"name":"@webreflection/fetch","version":"0.1.3","keywords":["fetch","response","merged"],"author":{"name":"Andrea Giammarchi"},"license":"MIT","_id":"@webreflection/fetch@0.1.3","maintainers":[{"name":"webreflection","email":"andrea.giammarchi@gmail.com"}],"homepage":"https://github.com/WebReflection/fetch#readme","bugs":{"url":"https://github.com/WebReflection/fetch/issues"},"dist":{"shasum":"fa99a465c53f50c1c65c42afb5b20faa94160b4d","tarball":"https://registry.npmjs.org/@webreflection/fetch/-/fetch-0.1.3.tgz","fileCount":8,"integrity":"sha512-fOCGzGk8+QA12qMDBiFbLdGf6mthjvQVFRq84duqE+zNCMLUkbvmyKbPPd5rlEy8N9HTz9rFvwn9U0knspVvXw==","signatures":[{"sig":"MEUCIFvnPamL9BabN6NPg1H8dEpV5eGY57KcTOqEOMnX48tpAiEA5/zOVziI8cvrAgBIdDWLtlM02FRBfIs1rGzFuqGhFrI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6863},"main":"./cjs/index.js","type":"module","unpkg":"es.js","module":"./esm/index.js","exports":{".":{"types":"./types/index.d.ts","import":"./esm/index.js","default":"./cjs/index.js"},"./package.json":"./package.json"},"gitHead":"516985e8c2578fe61beea8797554b4c8399c49c6","scripts":{"ts":"tsc -p .","cjs":"ascjs --no-default esm cjs","test":"c8 node test/index.js","build":"npm run cjs && npm run rollup:es && npm run ts && npm run test","coverage":"mkdir -p ./coverage; c8 report --reporter=text-lcov > ./coverage/lcov.info","rollup:es":"rollup --config rollup/es.config.js"},"_npmUser":{"name":"webreflection","email":"andrea.giammarchi@gmail.com"},"repository":{"url":"git+https://github.com/WebReflection/fetch.git","type":"git"},"_npmVersion":"10.4.0","description":"A fetch with Response abilities.","directories":{},"_nodeVersion":"21.6.1","_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","ascjs":"^6.0.3","rollup":"^4.10.0","typescript":"^5.3.3","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-node-resolve":"^15.2.3"},"_npmOperationalInternal":{"tmp":"tmp/fetch_0.1.3_1707985939510_0.22155907963852806","host":"s3://npm-registry-packages"}},"0.1.4":{"name":"@webreflection/fetch","version":"0.1.4","keywords":["fetch","response","merged"],"author":{"name":"Andrea Giammarchi"},"license":"MIT","_id":"@webreflection/fetch@0.1.4","maintainers":[{"name":"webreflection","email":"andrea.giammarchi@gmail.com"}],"homepage":"https://github.com/WebReflection/fetch#readme","bugs":{"url":"https://github.com/WebReflection/fetch/issues"},"dist":{"shasum":"ce1bb8e73301fbef767372ff8b2945878ed272be","tarball":"https://registry.npmjs.org/@webreflection/fetch/-/fetch-0.1.4.tgz","fileCount":8,"integrity":"sha512-oKjhwcg0Phu4e9UcAEnpwHFhnywZfcPQfP6erP4T4EGSquAX8ub8+b7lYaQ80yLG3YAV51a0Bu5hsypti6oK8w==","signatures":[{"sig":"MEUCIGc0vgszWvBZYlvQYx1lScAce2kS7K4H29NnVQEz/Ar1AiEA0/VCtUFGmyPo/DrcPiLaW+SKnumMjeLrmx8GqtYdTXI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6887},"main":"./cjs/index.js","type":"module","unpkg":"es.js","module":"./esm/index.js","exports":{".":{"types":"./types/index.d.ts","import":"./esm/index.js","default":"./cjs/index.js"},"./package.json":"./package.json"},"gitHead":"e49c0149988d86bc71a38d4ea014a1d17518bff4","scripts":{"ts":"tsc -p .","cjs":"ascjs --no-default esm cjs","test":"c8 node test/index.js","build":"npm run cjs && npm run rollup:es && npm run ts && npm run test","coverage":"mkdir -p ./coverage; c8 report --reporter=text-lcov > ./coverage/lcov.info","rollup:es":"rollup --config rollup/es.config.js"},"_npmUser":{"name":"webreflection","email":"andrea.giammarchi@gmail.com"},"repository":{"url":"git+https://github.com/WebReflection/fetch.git","type":"git"},"_npmVersion":"10.4.0","description":"A fetch with Response abilities.","directories":{},"_nodeVersion":"21.6.1","_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","ascjs":"^6.0.3","rollup":"^4.10.0","typescript":"^5.3.3","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-node-resolve":"^15.2.3"},"_npmOperationalInternal":{"tmp":"tmp/fetch_0.1.4_1708009283108_0.5532597163701527","host":"s3://npm-registry-packages"}},"0.1.5":{"name":"@webreflection/fetch","version":"0.1.5","keywords":["fetch","response","merged"],"author":{"name":"Andrea Giammarchi"},"license":"MIT","_id":"@webreflection/fetch@0.1.5","maintainers":[{"name":"webreflection","email":"andrea.giammarchi@gmail.com"}],"homepage":"https://github.com/WebReflection/fetch#readme","bugs":{"url":"https://github.com/WebReflection/fetch/issues"},"dist":{"shasum":"0d15e9a2c73dcc81e4b6fe7a2f8a34353de0a227","tarball":"https://registry.npmjs.org/@webreflection/fetch/-/fetch-0.1.5.tgz","fileCount":8,"integrity":"sha512-zCcqCJoNLvdeF41asAK71XPlwSPieeRDsE09albBunJEksuYPYNillKNQjf8p5BqSoTKTuKrW3lUm3MNodUC4g==","signatures":[{"sig":"MEQCIAOTgdpgxTwIdy9FzW1GO7VvAGJaUBmQN14RmLt5pW7+AiBtnN1r4Sp6MFcRG/hMihifqE74/9TP1/Pniihzlgpr+A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7152},"main":"./cjs/index.js","type":"module","unpkg":"es.js","module":"./esm/index.js","exports":{".":{"types":"./types/index.d.ts","import":"./esm/index.js","default":"./cjs/index.js"},"./package.json":"./package.json"},"gitHead":"0a6aae83d1e01fdad3d64d359443de46f8344b5e","scripts":{"ts":"tsc -p .","cjs":"ascjs --no-default esm cjs","test":"c8 node test/index.js","build":"npm run cjs && npm run rollup:es && npm run ts && npm run test","coverage":"mkdir -p ./coverage; c8 report --reporter=text-lcov > ./coverage/lcov.info","rollup:es":"rollup --config rollup/es.config.js"},"_npmUser":{"name":"webreflection","email":"andrea.giammarchi@gmail.com"},"repository":{"url":"git+https://github.com/WebReflection/fetch.git","type":"git"},"_npmVersion":"10.5.0","description":"A fetch with Response abilities.","directories":{},"_nodeVersion":"21.7.0","_hasShrinkwrap":false,"devDependencies":{"c8":"^9.1.0","ascjs":"^6.0.3","rollup":"^4.10.0","typescript":"^5.3.3","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-node-resolve":"^15.2.3"},"_npmOperationalInternal":{"tmp":"tmp/fetch_0.1.5_1710425997810_0.5468523138667472","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"@webreflection/fetch","version":"0.2.0","description":"A fetch with Response abilities.","main":"./cjs/index.js","scripts":{"build":"npm run cjs && npm run rollup:es && npm run ts && npm run test","cjs":"ascjs --no-default esm cjs","rollup:es":"rollup --config rollup/es.config.js","test":"c8 node test/index.js","ts":"tsc -p .","coverage":"mkdir -p ./coverage; c8 report --reporter=text-lcov > ./coverage/lcov.info"},"keywords":["fetch","response","merged"],"author":{"name":"Andrea Giammarchi"},"license":"MIT","devDependencies":{"@rollup/plugin-node-resolve":"^16.0.1","@rollup/plugin-terser":"^0.4.4","ascjs":"^6.0.3","c8":"^10.1.3","rollup":"^4.46.2","typescript":"^5.8.3"},"module":"./esm/index.js","type":"module","exports":{".":{"types":"./types/index.d.ts","import":"./esm/index.js","default":"./cjs/index.js"},"./package.json":"./package.json"},"unpkg":"es.js","repository":{"type":"git","url":"git+https://github.com/WebReflection/fetch.git"},"bugs":{"url":"https://github.com/WebReflection/fetch/issues"},"homepage":"https://github.com/WebReflection/fetch#readme","_id":"@webreflection/fetch@0.2.0","gitHead":"64a46560b4ef96920ac625be891cbbdb4dd3273f","_nodeVersion":"24.0.1","_npmVersion":"11.3.0","dist":{"integrity":"sha512-aI6INAtIUWn25x6D+wYpf4adWf3M91QFgobJXKTKW1Rzv40JuKoD+vIHy8aH03z/8LCMryl03N5n/wnU2qULOw==","shasum":"205983d887bf6d0a57a6a263c77e04151b33dc04","tarball":"https://registry.npmjs.org/@webreflection/fetch/-/fetch-0.2.0.tgz","fileCount":8,"unpackedSize":7501,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDWcvJnFHUxEGPmmeGfBdi1YR+H4Oo/ZcIoHY+GeCZ1vgIgTUO0KXvhMfHMsdeRAqcNBYF8Bxr5LHkFe1HUfEapxuQ="}]},"_npmUser":{"name":"webreflection","email":"andrea.giammarchi@gmail.com"},"directories":{},"maintainers":[{"name":"webreflection","email":"andrea.giammarchi@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fetch_0.2.0_1753875154997_0.29125639477416554"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-14T16:44:28.140Z","modified":"2025-07-30T11:32:35.362Z","0.0.0":"2024-02-14T16:44:28.413Z","0.1.0":"2024-02-14T16:47:35.721Z","0.1.1":"2024-02-14T16:48:35.976Z","0.1.2":"2024-02-14T19:55:53.152Z","0.1.3":"2024-02-15T08:32:19.660Z","0.1.4":"2024-02-15T15:01:23.312Z","0.1.5":"2024-03-14T14:19:57.934Z","0.2.0":"2025-07-30T11:32:35.173Z"},"bugs":{"url":"https://github.com/WebReflection/fetch/issues"},"author":{"name":"Andrea Giammarchi"},"license":"MIT","homepage":"https://github.com/WebReflection/fetch#readme","keywords":["fetch","response","merged"],"repository":{"type":"git","url":"git+https://github.com/WebReflection/fetch.git"},"description":"A fetch with Response abilities.","maintainers":[{"name":"webreflection","email":"andrea.giammarchi@gmail.com"}],"readme":"# fetch\n\n<sup>**Social Media Photo by [Anthony Duran](https://unsplash.com/@dogflirt) on [Unsplash](https://unsplash.com/)**</sup>\n\n[![build](https://github.com/WebReflection/fetch/actions/workflows/node.js.yml/badge.svg)](https://github.com/WebReflection/fetch/actions/workflows/node.js.yml) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/fetch/badge.svg?branch=main)](https://coveralls.io/github/WebReflection/fetch?branch=main)\n\nA fetch with Response abilities.\n\n<sup>(... see what I did there?)</sup>\n\n```js\nimport fetch from '@webreflection/fetch';\n\n// await directly Response methods or accessors\nconsole.log(await fetch('https://google.com').text());\nconsole.log(await fetch('https://google.com').ok);\n\n// all other Promise methods just work\nconsole.log(await fetch('https://google.com').then(r => r.ok));\n```\n\nThe export is simply a Proxy that forwards to the Response any explicit intent, meaning:\n\n  * a `fetch(url, ...init)` returns exactly a `fetch(url, ...init)` reference\n    * you can do everything you could do already with `fetch` ... **this is fetch** indeed!\n    * you can use this module as drop-in replacement in your current code though\n    * you can eventually incrementally use its features *if* and/or *when* needed\n  * if any `Response.prototype` known *key* is directly accessed, such property or method is forwarded directly to the *response* once the *fetch* is resolved\n  * as the goal is to shortcut the *response* boilerplate, `Response.prototype` keys prevail over `Promise.prototype` so if your argument is that `Symbol.toStringTag` returned the response one, I am afraid that's meant by design so that unless *Promise* API introduces a conflicting entry name with *Response* API, this module actually requires zero maintainability and it's future-friendly with API changes and whatnot\n  * if you want to deal with `status` or `ok` or `headers` you still can do that:\n    * reference `const req = fetch(url, ...init)`\n    * use `try/catch` around `req.json()` or `req.text()` or any other forwarded method\n    * use `const { status, headers } = await req` or `const status = await req.status` or any other way you like to introspect the failure\n\n```js\n// alternatively ...\nconst { ok, text } = await fetch(URL);\nif (ok) console.log(await text());\n```\n\nIf none of this is interesting to you though, we're good! You can move on happily ever after 👋\n","readmeFilename":"README.md"}