Socket
Socket
Sign inDemoInstall

node-fetch-with-proxy

Package Overview
Dependencies
64
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

.github/workflows/nodejs.yml

2

lib/fetch-with-proxy.js

@@ -9,2 +9,2 @@ 'use strict';

return fetch(url, { agent, ...options });
}
};
{
"name": "node-fetch-with-proxy",
"version": "0.1.0",
"version": "0.1.1",
"description": "node-fetch with proxy-agent",

@@ -8,3 +8,4 @@ "main": "lib/fetch-with-proxy.js",

"scripts": {
"test": "node test/test.js"
"test": "jest",
"format": "prettier --write \"{lib,test}/**/*.js\""
},

@@ -15,3 +16,7 @@ "repository": {

},
"keywords": [],
"keywords": [
"http",
"fetch",
"proxy"
],
"author": "Shinsuke Noguchi <shinsuke.noguchi@gmail.com>",

@@ -26,3 +31,12 @@ "license": "MIT",

"proxy-agent": "^3.1.1"
},
"devDependencies": {
"http-proxy": "^1.18.0",
"jest": "^24.9.0",
"prettier": "^1.19.1"
},
"prettier": {
"singleQuote": true,
"printWidth": 120
}
}
# node-fetch-with-proxy
Simple integration of [node-fetch](https://www.npmjs.com/package/node-fetch) and [proxy-agent](https://www.npmjs.com/package/proxy-agent)
Thin wrapper of [node-fetch](https://www.npmjs.com/package/node-fetch) that can be used behind the proxy.
The proxy specified by the environment variable (HTTP_PROXY, https_proxy, etc.) is used in Node.js environment.
## Install
```sh
$ npm install node-fetch-with-proxy
```
## Usage
See [node-fetch](https://www.npmjs.com/package/node-fetch)
## Advanced Usage
You can explicitly specify proxy options with the 3rd argument of `fetch` API.
```javascript
const proxyUrl = 'http://your.proxy:port';
fetch('https://httpbin.org/post', {
method: 'POST',
body: 'foo=bar'
}, proxyUrl);
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc