# @buttercup/fetch

> Fetch adapter for cross-platform use.

Latest version **0.2.1** (published 2023-09-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @buttercup/fetch
pnpm add @buttercup/fetch
yarn add @buttercup/fetch
bun add @buttercup/fetch
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2023-09-12 |
| First published | 2023-02-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Perry Mitchell |
| Maintainers | perrymitchell, sallar |
| Keywords | fetch, request |

## Links

- npm: https://www.npmjs.com/package/@buttercup/fetch
- Repository: https://github.com/buttercup/fetch
- Homepage: https://github.com/buttercup/fetch#readme
- Issues: https://github.com/buttercup/fetch/issues
- npm.io page: https://npm.io/package/@buttercup/fetch

## Dependencies (1)

- [node-fetch](https://npm.io/package/node-fetch.md) ^3.3.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.2.1 (latest) — 2023-09-12
- 0.2.0 — 2023-09-12
- 0.1.2 — 2023-07-18
- 0.1.1 — 2023-04-24
- 0.1.0 — 2023-02-05

## README

# Fetch
> Fetch adapter for cross-platform use.

[![Buttercup](https://cdn.rawgit.com/buttercup-pw/buttercup-assets/6582a033/badge/buttercup-slim.svg)](https://buttercup.pw) [![npm (scoped)](https://img.shields.io/npm/v/@buttercup/fetch)](https://www.npmjs.com/package/@buttercup/fetch) ![Tests](https://github.com/buttercup/fetch/actions/workflows/test.yml/badge.svg)

## 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:

```shell
npm install @buttercup/fetch --save-dev
```

For NodeJS use you must also install `node-fetch`:

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

## Usage

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

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

// ...

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

---
_Source: https://npm.io/package/@buttercup/fetch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
