# omni-fetch

> wrapper for isomorphic fetch with proxy support

Latest version **0.2.3** (published 2017-12-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install omni-fetch
pnpm add omni-fetch
yarn add omni-fetch
bun add omni-fetch
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2017-12-15 |
| First published | 2016-03-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Mario Nebl |
| Maintainers | marionebl |
| Keywords | fetch, proxy, proxy-auth |

## Links

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

## Dependencies (3)

- [caw](https://npm.io/package/caw.md) ^1.2.0
- [@types/node](https://npm.io/package/@types/node.md) ^6.0.52
- [@types/isomorphic-fetch](https://npm.io/package/@types/isomorphic-fetch.md) 0.0.31

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 0.2.3 (latest) — 2017-12-15
- 0.2.2 — 2016-12-23
- 0.2.1 — 2016-12-23
- 0.2.0 — 2016-03-14
- 0.1.1 — 2016-03-13
- 0.1.0 — 2016-03-12
- 0.0.0 — 2016-03-12

## README

# omni-fetch

> wrapper for isomorphic fetch with proxy support

omni-fetch combines the excellent
[isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch)
and
[caw](https://github.com/kevva/caw)
modules to enable easy http and https proxy support for your node
application.

## Installation

```bash
npm install --save omni-fetch isomorphic-fetch
```

## Usage

```js
import fetch from 'omni-fetch';
fetch('https://www.sinnerschrader.com');
```

---

⇨ See the
[fetch documenation](https://github.com/matthew-andrews/isomorphic-fetch#usage)
for details

### Proxy Support

Specify proxy configuration via `HTTP_PROXY`
and `HTTPS_PROXY` environment variables,
or their all-lowercase twins.
Assuming a local proxy server available at `http://localhost:8080`:

```bash
export HTTP_PROXY=http://localhost:8080
export HTTPS_PROXY=http://localhost:8080
npm start
```

---

⇨ The specified proxy configuration will be picked up for all
communication via `omni-fetch` on the server-side.
Client-side `fetch` will use the client's proxy configuration.

### Overriding global configuration

`omni-fetch` default proxy configuration can be overridden by
passing an `agent` option to fetch:

```js
import https from 'https';
import fetch from 'omni-fetch';

process.env.HTTPS_PROXY = 'http://localhost:8080';

// Uses http://localhost:8080
fetch('https://sinnerschrader.com');

// Uses no proxy
fetch('https://sinnerschrader.com', {
  agent: https.globalAgent
});
```

---

Copyright 2016 by [Mario Nebl](https://github.com/marionebl)
and [contributors](./graphs/contributors). Released under the [MIT license]('./license.md').

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