{"_id":"sync-fetch","_rev":"1168897","name":"sync-fetch","description":"Synchronous version of the Fetch API","dist-tags":{"latest":"0.3.1"},"maintainers":[{"name":"larsgw","email":"lars.willighagen@gmail.com"}],"time":{"modified":"2021-10-09T13:11:00.000Z","created":"2019-08-29T18:27:55.565Z","0.3.1":"2021-10-09T13:08:09.950Z","0.3.0":"2020-11-02T08:22:47.765Z","0.2.1":"2020-11-02T08:09:39.203Z","0.2.0":"2020-06-27T21:44:42.835Z","0.1.1":"2019-10-24T18:06:57.001Z","0.1.0":"2019-08-29T18:27:55.565Z"},"users":{},"author":{"name":"Lars Willighagen"},"repository":{"type":"git","url":"git+https://github.com/larsgw/sync-fetch.git"},"versions":{"0.3.1":{"name":"sync-fetch","version":"0.3.1","description":"Synchronous version of the Fetch API","main":"index.js","browser":"browser.js","scripts":{"lint":"standard","test":"mocha --throw-deprecation test/spec.js","build":"browserify -r .:sync-fetch -o bundle.js","preversion":"npm run lint && npm run test","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":{"buffer":"^5.7.0","node-fetch":"^2.6.1"},"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","form-data":"^3.0.0","mocha":"^8.2.0","parted":"^0.1.1","resumer":"0.0.0","standard":"^16.0.1","string-to-arraybuffer":"^1.0.2","sync-request":"^6.1.0","whatwg-url":"^8.4.0"},"engines":{"node":">=8"},"gitHead":"516b42d0b5741c40b6aff4580cc2b8707836d45d","_id":"sync-fetch@0.3.1","_nodeVersion":"12.19.0","_npmVersion":"7.22.0","dist":{"shasum":"62aa82c4b4d43afd6906bfd7b5f92056458509f0","size":32436,"noattachment":false,"key":"/sync-fetch/-/sync-fetch-0.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-fetch/download/sync-fetch-0.3.1.tgz"},"_npmUser":{"name":"larsgw","email":"lars.willighagen@gmail.com"},"directories":{},"maintainers":[{"name":"larsgw","email":"lars.willighagen@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-fetch_0.3.1_1633784889756_0.07679528499233723"},"_hasShrinkwrap":false,"publish_time":1633784889950,"_cnpm_publish_time":1633784889950},"0.3.0":{"name":"sync-fetch","version":"0.3.0","description":"Synchronous version of the Fetch API","main":"index.js","browser":"browser.js","scripts":{"lint":"standard","test":"mocha --throw-deprecation test/spec.js","build":"browserify -r .:sync-fetch -o bundle.js","preversion":"npm run lint && npm run test","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":{"buffer":"^5.7.0","node-fetch":"^2.6.1"},"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","form-data":"^3.0.0","mocha":"^8.2.0","parted":"^0.1.1","resumer":"0.0.0","standard":"^16.0.1","string-to-arraybuffer":"^1.0.2","sync-request":"^6.1.0","whatwg-url":"^8.4.0"},"engines":{"node":">=8"},"gitHead":"59ea2edc3d331bf63c4e62b242e2fbdd9c9b9b7e","_id":"sync-fetch@0.3.0","_nodeVersion":"12.14.0","_npmVersion":"6.14.8","dist":{"shasum":"77246da949389310ad978ab26790bb05f88d1335","size":30779,"noattachment":false,"key":"/sync-fetch/-/sync-fetch-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-fetch/download/sync-fetch-0.3.0.tgz"},"maintainers":[{"name":"larsgw","email":"lars.willighagen@gmail.com"}],"_npmUser":{"name":"larsgw","email":"lars.willighagen@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-fetch_0.3.0_1604305367636_0.008488102869375957"},"_hasShrinkwrap":false,"publish_time":1604305367765,"_cnpm_publish_time":1604305367765},"0.2.1":{"name":"sync-fetch","version":"0.2.1","description":"Synchronous version of the Fetch API","main":"index.js","browser":"browser.js","scripts":{"lint":"standard","test":"mocha --throw-deprecation test/spec.js","build":"browserify -r .:sync-fetch -o bundle.js","preversion":"npm run lint && npm run test","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":{"buffer":"^5.7.0","node-fetch":"^2.6.1"},"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","form-data":"^3.0.0","mocha":"^6.2.0","parted":"^0.1.1","resumer":"0.0.0","standard":"^13.1.0","string-to-arraybuffer":"^1.0.2","sync-request":"^6.1.0","whatwg-url":"^7.1.0"},"engines":{"node":">=8"},"gitHead":"78d989a741c149bc7a499766d2e50474bece41b1","_id":"sync-fetch@0.2.1","_nodeVersion":"12.14.0","_npmVersion":"6.14.8","dist":{"shasum":"55cc01d7485bd92cb1fc22fd6270cdf811e787ee","size":30773,"noattachment":false,"key":"/sync-fetch/-/sync-fetch-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-fetch/download/sync-fetch-0.2.1.tgz"},"maintainers":[{"name":"larsgw","email":"lars.willighagen@gmail.com"}],"_npmUser":{"name":"larsgw","email":"lars.willighagen@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-fetch_0.2.1_1604304579066_0.5331609005365492"},"_hasShrinkwrap":false,"publish_time":1604304579203,"_cnpm_publish_time":1604304579203},"0.2.0":{"name":"sync-fetch","version":"0.2.0","description":"Synchronous version of the Fetch API","main":"index.js","browser":"browser.js","scripts":{"lint":"standard","test":"mocha --throw-deprecation test/spec.js","build":"browserify -r .:sync-fetch -o bundle.js","preversion":"npm run lint && npm run test","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":{"buffer":"^5.4.2","node-fetch":"^2.6.0"},"devDependencies":{"@ungap/url-search-params":"^0.1.2","browserify":"^16.5.0","chai":"^4.2.0","chai-iterator":"^3.0.2","chai-string":"^1.5.0","form-data":"^2.5.0","mocha":"^6.2.0","parted":"^0.1.1","resumer":"0.0.0","standard":"^13.1.0","string-to-arraybuffer":"^1.0.2","sync-request":"^6.1.0","whatwg-url":"^7.0.0"},"engines":{"node":">=8"},"gitHead":"ccf55a4f4c18b04d59ea9dca2dd1a86a83f08f20","_id":"sync-fetch@0.2.0","_nodeVersion":"12.14.0","_npmVersion":"6.14.2","dist":{"shasum":"e53fe8b24d4f2ca22b91b11bbdd4ad7ba6bd4c10","size":19954,"noattachment":false,"key":"/sync-fetch/-/sync-fetch-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-fetch/download/sync-fetch-0.2.0.tgz"},"maintainers":[{"name":"larsgw","email":"lars.willighagen@gmail.com"}],"_npmUser":{"name":"larsgw","email":"lars.willighagen@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-fetch_0.2.0_1593294282605_0.9906626251058648"},"_hasShrinkwrap":false,"publish_time":1593294282835,"_cnpm_publish_time":1593294282835},"0.1.1":{"name":"sync-fetch","version":"0.1.1","description":"Synchronous version of the Fetch API","main":"index.js","browser":"browser.js","scripts":{"lint":"standard","test":"mocha --throw-deprecation test/spec.js","build":"browserify -r .:sync-fetch -o bundle.js","preversion":"npm run lint && npm run test","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":{"buffer":"^5.4.2","node-fetch":"^2.6.0"},"devDependencies":{"@ungap/url-search-params":"^0.1.2","browserify":"^16.5.0","chai":"^4.2.0","chai-iterator":"^3.0.2","chai-string":"^1.5.0","form-data":"^2.5.0","mocha":"^6.2.0","parted":"^0.1.1","resumer":"0.0.0","standard":"^13.1.0","string-to-arraybuffer":"^1.0.2","sync-request":"^6.1.0","whatwg-url":"^7.0.0"},"engines":{"node":">=8"},"gitHead":"7726904216a5dedbd56a7eb4dffbf0a87fbbda0b","_id":"sync-fetch@0.1.1","_nodeVersion":"12.11.0","_npmVersion":"6.12.0","dist":{"shasum":"7fb85ac91eed81f3a164f8088d6dd146aa466071","size":19916,"noattachment":false,"key":"/sync-fetch/-/sync-fetch-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-fetch/download/sync-fetch-0.1.1.tgz"},"maintainers":[{"name":"larsgw","email":"lars.willighagen@gmail.com"}],"_npmUser":{"name":"larsgw","email":"lars.willighagen@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-fetch_0.1.1_1571940416836_0.9584255487672124"},"_hasShrinkwrap":false,"publish_time":1571940417001,"_cnpm_publish_time":1571940417001},"0.1.0":{"name":"sync-fetch","version":"0.1.0","description":"Synchronous version of the Fetch API","main":"index.js","browser":"browser.js","scripts":{"lint":"standard","test":"mocha --throw-deprecation test/spec.js","build":"browserify -r .:sync-fetch -o bundle.js","preversion":"npm run lint && npm run test","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":{"buffer":"^5.4.2","node-fetch":"^2.6.0"},"devDependencies":{"@ungap/url-search-params":"^0.1.2","browserify":"^16.5.0","chai":"^4.2.0","chai-iterator":"^3.0.2","chai-string":"^1.5.0","form-data":"^2.5.0","mocha":"^6.2.0","parted":"^0.1.1","resumer":"0.0.0","standard":"^13.1.0","string-to-arraybuffer":"^1.0.2","sync-request":"^6.1.0","whatwg-url":"^7.0.0"},"engines":{"node":">=8"},"gitHead":"2e1f7ab5c99343cfbe2a9b5ba99234078f4ca148","_id":"sync-fetch@0.1.0","_nodeVersion":"8.15.1","_npmVersion":"6.11.2","dist":{"shasum":"0106b6daf72f799a4ee515ae2288abf229894c09","size":19850,"noattachment":false,"key":"/sync-fetch/-/sync-fetch-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-fetch/download/sync-fetch-0.1.0.tgz"},"maintainers":[{"name":"larsgw","email":"lars.willighagen@gmail.com"}],"_npmUser":{"name":"larsgw","email":"lars.willighagen@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-fetch_0.1.0_1567103275376_0.8654406911236161"},"_hasShrinkwrap":false,"publish_time":1567103275565,"_cnpm_publish_time":1567103275565}},"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\n## Install\n\n    npm install sync-fetch\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// json(), arrayBuffer(), text() and buffer() supported\n```\n\n## Limitations\n\n### Node.js\n\n  - Does not support `Stream`s (or `FormData`) as input bodies since they cannot be read or serialized synchronously\n  - Does not support `Blob`s as input bodies since they're too complex\n  - Does not support the non-spec `agent` option as its value cannot be serialized\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  - Does not support [binary responses in the main thread](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType#Synchronous_XHR_restrictions)\n  - CORS limitations apply, of course (note they may be stricter for synchronous requests)\n","_attachments":{},"homepage":"https://github.com/larsgw/sync-fetch#readme","bugs":{"url":"https://github.com/larsgw/sync-fetch/issues"},"license":"MIT"}