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, like browsers.
import fetch from 'fetch-with-proxy';
const url = 'https://nodejs.org/';
fetch(url)
.then((response) => response.text());
.then(console.log)
.catch(console.error)
With npm:
$ npm install fetch-with-proxy
Use mocha to run the tests.
$ mocha test
see https://github.com/matthew-andrews/isomorphic-fetch