Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

make-fetch-happen

Package Overview
Dependencies
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

make-fetch-happen - npm Package Compare versions

Comparing version 1.5.1 to 1.6.0

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="1.6.0"></a>
# [1.6.0](https://github.com/zkat/make-fetch-happen/compare/v1.5.1...v1.6.0) (2017-04-06)
### Features
* **agent:** better, keepalive-supporting, default http agents ([16277f6](https://github.com/zkat/make-fetch-happen/commit/16277f6))
<a name="1.5.1"></a>

@@ -7,0 +17,0 @@ ## [1.5.1](https://github.com/zkat/make-fetch-happen/compare/v1.5.0...v1.5.1) (2017-04-05)

21

index.js

@@ -5,4 +5,2 @@ 'use strict'

const fetch = require('node-fetch')
const http = require('http')
const https = require('https')
let ProxyAgent

@@ -13,3 +11,2 @@ const pkg = require('./package.json')

const Stream = require('stream')
const url = require('url')

@@ -316,2 +313,4 @@ // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch

let httpsAgent
let httpAgent
function getAgent (uri, opts) {

@@ -326,6 +325,14 @@ if (opts.agent != null) {

return new ProxyAgent(opts.proxy)
} else if (url.parse(uri).protocol === 'https:') {
return https.globalAgent
} else if (url.parse(uri).protocol === 'http:') {
return http.globalAgent
} else if (uri.trim().startsWith('https:')) {
if (!httpsAgent) {
const Agent = require('agentkeepalive').HttpsAgent
httpsAgent = new Agent({maxSockets: 15})
}
return httpsAgent
} else {
if (!httpAgent) {
const Agent = require('agentkeepalive')
httpAgent = new Agent({maxSockets: 15})
}
return httpAgent
}

@@ -332,0 +339,0 @@ }

{
"name": "make-fetch-happen",
"version": "1.5.1",
"version": "1.6.0",
"description": "Opinionated, caching, retrying fetch client",

@@ -36,2 +36,3 @@ "main": "index.js",

"dependencies": {
"agentkeepalive": "^3.1.0",
"bluebird": "^3.5.0",

@@ -38,0 +39,0 @@ "cacache": "^7.0.3",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc