镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
buttercupPublic

About

Fetch adapter for cross-platform use.

Resources

Stars

2 stars

Watchers

2 watching

Forks

Repository files navigation

Fetch

Fetch adapter for cross-platform use.

Buttercup npm (scoped) Tests

About

This library exports fetch in various environments, such as within a browser or under NodeJS:

  • Browsers get the native window.fetch
  • NodeJS gets node-fetch

This library was designed to be used primarily within Buttercup and its supporting libraries: Features and fixes implemented here will be oriented to furthering Buttercup's goals, and unnessarily changes may be rejected due to that.

Installation

For browser use you need only install this library:

npm install @buttercup/fetch --save-dev

For NodeJS use you must also install node-fetch:

npm install @buttercup/fetch node-fetch --save

Usage

You can import the various components related to fetch regardless of the entry your application uses:

import {
    fetch,
    Headers,
    Request,
    Response
} from "@buttercup/fetch";

// ...

const res = await fetch("https://...");

About

Fetch adapter for cross-platform use.

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages