Synchronous version of the Fetch API
npm install sync-fetchnode-fetch under the hood, and for some input-parsing code and test cases too.

npm install sync-fetch
In the browser, a browserify bundle can be loaded from CDNs like unpkg.com.
``html`
`js
const fetch = require('sync-fetch')
const metadata = fetch('https://doi.org/10.7717/peerj-cs.214', {
headers: {
Accept: 'application/vnd.citationstyles.csl+json'
}
}).json()
// arrayBuffer(), blob(), buffer(), json(), and text() supported
`
- Does not support Stream or Blob as input body since they cannot be read or serialized synchronouslyFormData
- Does not support as input body yet as it has no built-in method to be serializedagent
- Does not support the non-spec option as its value cannot be serializedtextConverted()
- Does not support non-standard method on SyncResponse and SyncRequest
- Does not support most options, since XMLHttpRequest is pretty limited. Supported are:method
- body
- headers
- credentials
- (but not omit)timeout
- (Non-spec) buffer()
- The non-standard and textConverted()` methods are not supported
- CORS limitations apply, of course (note they may be stricter for synchronous requests)