JSPM

node-fetch-with-proxy

0.1.6
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1582
  • Score
    100M100P100Q142371F
  • License MIT

node-fetch with proxy-agent

Package Exports

  • node-fetch-with-proxy

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-fetch-with-proxy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-fetch-with-proxy

Thin wrapper of node-fetch that can be used behind the proxy.

Install

npm install node-fetch-with-proxy

Usage

API is the same as node-fetch.

const fetch = require('node-fetch-with-proxy');

fetch('http://httpbin.org/get')
  .then(res => res.json())
  .then(json => console.log(json));

Unlike node-fetch, proxy can be set by environment variable.

export HTTP_PROXY=http://your.proxy:8888

Environment variables are only valid for Node.js. Note that the browser uses its own proxy settings instead.