# fetch-with-proxy

> Wrap node-fetch to enable proxy use.

Latest version **3.0.1** (published 2020-12-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install fetch-with-proxy
pnpm add fetch-with-proxy
yarn add fetch-with-proxy
bun add fetch-with-proxy
```

## 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.1 |
| Published | 2020-12-21 |
| First published | 2018-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 10.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Nicolas Thouvenin |
| Maintainers | touv |
| Keywords | http, fetch, proxy |

## Links

- npm: https://www.npmjs.com/package/fetch-with-proxy
- Repository: https://github.com/touv/node-fetch-with-proxy
- Homepage: https://github.com/touv/node-fetch-with-proxy#readme
- Issues: https://github.com/touv/node-fetch-with-proxy/issues
- npm.io page: https://npm.io/package/fetch-with-proxy

## Dependencies (4)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.1
- [tunnel-agent](https://npm.io/package/tunnel-agent.md) ^0.6.0
- [proxy-from-env](https://npm.io/package/proxy-from-env.md) ^1.1.0
- [node-abort-controller](https://npm.io/package/node-abort-controller.md) ^1.1.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

- 3.0.1 (latest) — 2020-12-21
- 3.0.0 — 2020-12-16
- 2.0.1 — 2020-07-21
- 2.0.0 — 2020-07-21
- 1.1.0 — 2018-01-09
- 1.0.1 — 2018-01-08
- 1.0.0 — 2018-01-08

## README

# Use fetch behind a proxy


A wrapper of fetch that can be use behind a proxy.

It detect standard environment variables (HTTP_PROXY, https_proxy, etc.) to choose and use the proxy.

Unlike many similar packages, this one does **not use tunnel** in HTTP, like [request](https://github.com/request/request), like browsers.


# Example

```javascript

import fetch from 'fetch-with-proxy';

const url = 'https://nodejs.org/';
fetch(url)
      .then((response) => response.text());
      .then(console.log)
      .catch(console.error)


```

# Installation

With [npm](http://npmjs.org):

    $ npm install fetch-with-proxy

# Tests

Use [mocha](https://github.com/visionmedia/mocha) to run the tests.

    $ mocha test

# Environment variables

  * HTTP_PROXY
  * http_proxy
  * HTTPS_PROXY
  * https_proxy
  * ALL_PROXY
  * NO_PROXY

# API Documentation

see https://www.npmjs.com/package/node-fetch


# Related projects

* https://www.npmjs.com/package/proxy-agent
* https://www.npmjs.com/package/better-https-proxy-agent
* https://www.npmjs.com/package/https-proxy-agent
* https://github.com/kevva/caw




# License

[MIT/X11](https://github.com/touv/node-fetch-with-proxy/blob/master/LICENSE)

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