# @applitools/isomorphic-fetch

> Isomorphic WHATWG Fetch API, for Node & Browserify

Latest version **3.0.0** (published 2018-12-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @applitools/isomorphic-fetch
pnpm add @applitools/isomorphic-fetch
yarn add @applitools/isomorphic-fetch
bun add @applitools/isomorphic-fetch
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2018-12-19 |
| First published | 2018-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Matt Andrews |
| Maintainers | amirhalatzi, danielputerman, oleh-applitools, annab1, amitzur, ramapplitools, eyalgut, gal_applitools, applitools-admin, applitools-readonly, giltayar, corevo |

## Links

- npm: https://www.npmjs.com/package/@applitools/isomorphic-fetch
- Repository: https://github.com/applitools/isomorphic-fetch
- Homepage: https://github.com/matthew-andrews/isomorphic-fetch/issues
- Issues: https://github.com/matthew-andrews/isomorphic-fetch/issues
- npm.io page: https://npm.io/package/@applitools/isomorphic-fetch

## Dependencies (2)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.3.0
- [whatwg-fetch](https://npm.io/package/whatwg-fetch.md) >=0.10.0

## Recent versions

- 3.0.0 (latest) — 2018-12-19

## README

isomorphic-fetch [![Build Status](https://travis-ci.org/matthew-andrews/isomorphic-fetch.svg?branch=master)](https://travis-ci.org/matthew-andrews/isomorphic-fetch)
================

Fetch for node and Browserify.  Built on top of [GitHub's WHATWG Fetch polyfill](https://github.com/github/fetch).

## Warnings

- This adds `fetch` as a global so that its API is consistent between client and server.
- You must bring your own ES6 Promise compatible polyfill, I suggest [es6-promise](https://github.com/jakearchibald/es6-promise).

For [ease-of-maintenance and backward-compatibility reasons][why polyfill], this library will always be a polyfill. As a "safe" alternative, which does not modify the global, consider [fetch-ponyfill][].

[why polyfill]: https://github.com/matthew-andrews/isomorphic-fetch/issues/31#issuecomment-149668361
[fetch-ponyfill]: https://github.com/qubyte/fetch-ponyfill

## Installation

### NPM

```sh
npm install --save isomorphic-fetch es6-promise
```

### Bower

```sh
bower install --save isomorphic-fetch es6-promise
```

## Usage

```js
require('es6-promise').polyfill();
require('isomorphic-fetch');

fetch('//offline-news-api.herokuapp.com/stories')
	.then(function(response) {
		if (response.status >= 400) {
			throw new Error("Bad response from server");
		}
		return response.json();
	})
	.then(function(stories) {
		console.log(stories);
	});
```

## License

All open source code released by FT Labs is licenced under the MIT licence.  Based on [the fine work by](https://github.com/github/fetch/pull/31) **[jxck](https://github.com/Jxck)**.

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