{"name":"sync-fetch","version":"0.6.0","description":"Synchronous version of the Fetch API","main":"index.js","browser":"browser.js","jsdelivr":"bundle.js","unpkg":"bundle.js","scripts":{"lint":"standard","test":"mocha --throw-deprecation test/spec.js","build":"browserify -r .:sync-fetch -o bundle.js","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md","preversion":"npm run lint && npm run test","version":"npm run changelog","prepare":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/larsgw/sync-fetch.git"},"keywords":["fetch","sync"],"author":{"name":"Lars Willighagen"},"license":"MIT","bugs":{"url":"https://github.com/larsgw/sync-fetch/issues"},"homepage":"https://github.com/larsgw/sync-fetch#readme","dependencies":{"node-fetch":"^3.3.2","timeout-signal":"^2.0.0","whatwg-mimetype":"^4.0.0"},"devDependencies":{"@ungap/url-search-params":"^0.2.2","browserify":"^17.0.0","chai":"^4.2.0","chai-iterator":"^3.0.2","chai-string":"^1.5.0","conventional-changelog-cli":"^3.0.0","form-data":"^4.0.0","mocha":"^10.0.0","parted":"^0.1.1","resumer":"0.0.0","standard":"^17.0.0","string-to-arraybuffer":"^1.0.2"},"engines":{"node":">=18"},"gitHead":"ad8b6d454d30e5407dbb45db3ee7984a16232895","_id":"sync-fetch@0.6.0","_nodeVersion":"20.17.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-IELLEvzHuCfc1uTsshPK58ViSdNqXxlml1U+fmwJIKLYKOr/rAtBrorE2RYm5IHaMpDNlmC0fr1LAvdXvyheEQ==","shasum":"5759e775f3d5202e1b3d14821bc152fec32aa180","tarball":"http://registry-npm.ywwl.com/sync-fetch/download/sync-fetch-0.6.0.tgz","fileCount":12,"unpackedSize":43253,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDGENqcoT3UXSiero9fAAi4eoil1wwcvxhPwTQUxXEu7gIgFLCNK7lBNACU+OEJZAd2XSTs0t+buFR4JkUaSAFojcM="}],"size":9938,"noattachment":false,"key":"/sync-fetch/-/sync-fetch-0.6.0.tgz"},"_npmUser":{"name":"larsgw","email":"lars.willighagen@gmail.com"},"directories":{},"maintainers":[{"name":"larsgw","email":"lars.willighagen@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sync-fetch_0.6.0_1767301927134_0.22543508618802277"},"_hasShrinkwrap":false,"readme":"# sync-fetch\nSynchronous wrapper around the Fetch API. Uses [`node-fetch`](https://github.com/bitinn/node-fetch) under the hood, and for some input-parsing code and test cases too.\n\n[![npm](https://img.shields.io/npm/v/sync-fetch?style=flat-square)](https://npmjs.com/package/sync-fetch)\n[![npm monthly downloads](https://img.shields.io/npm/dm/sync-fetch?style=flat-square)](https://npm-stat.com/charts.html?package=sync-fetch)\n\n## Install\n\n    npm install sync-fetch\n\nIn the browser, a browserify bundle can be loaded from CDNs like unpkg.com.\n\n```html\n<script src=\"https://unpkg.com/sync-fetch\"></script>\n<script src=\"https://unpkg.com/sync-fetch@VERSION\"></script>\n```\n\n## Use\n\n```js\nconst fetch = require('sync-fetch')\n\nconst metadata = fetch('https://doi.org/10.7717/peerj-cs.214', {\n  headers: {\n    Accept: 'application/vnd.citationstyles.csl+json'\n  }\n}).json()\n// arrayBuffer(), blob(), buffer(), json(), and text() supported\n```\n\n## Limitations\n\n### Node.js\n\n  - Does not support `Stream` or `Blob` as input body since they cannot be read or serialized synchronously\n  - Does not support `FormData` as input body yet as it has no built-in method to be serialized\n  - Does not support the non-spec `agent` option as its value cannot be serialized\n  - Does not support non-standard `textConverted()` method on `SyncResponse` and `SyncRequest`\n\n### Browser\n\n  - Does not support most options, since `XMLHttpRequest` is pretty limited. Supported are:\n    - `method`\n    - `body`\n    - `headers`\n    - `credentials` (but not `omit`)\n    - (Non-spec) `timeout`\n  - The non-standard `buffer()` and `textConverted()` methods are not supported\n  - CORS limitations apply, of course (note they may be stricter for synchronous requests)\n","publish_time":1767301927279,"_cnpm_publish_time":1767301927279,"dist-tags":{"latest":"0.7.1"}}