Socket
Socket
Sign inDemoInstall

asyncawait-fetch

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    asyncawait-fetch

async/await wrapper around GitHub's Fetch polyfill


Version published
Maintainers
1
Install size
2.02 MB
Created

Readme

Source

asyncawait-fetch

async/await wrapper around GitHub's Fetch polyfill.

Dependencies

  • fetch available to import
  • regenerator available to transform async functions

Usage

asyncawait-fetch can be used as a drop in replacement for fetch by importing the library as a named alias import, i.e.

import { asyncawaitFetch as fetch } from 'asyncawait-fetch'

async function basicExample () {
  return await fetch(`/users.json`)
}

async function optionsExample () {
  return await fetch(`/users`, {
    method: `post`,
    body: new FormData(form)
  })
}

async function overrideExample () {
  return await fetch(`/users.html`, null, `json`)
}

License

Released under the MIT license: opensource.org/licenses/MIT

Keywords

FAQs

Last updated on 09 Aug 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc