@zeit/fetch

Opinionated `fetch` optimized for use inside microservices

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@zeit/fetch
502166.0.03 years ago5 years agoMinified + gzip package size for @zeit/fetch in KB

Readme

@zeit/fetch
Build Status
Opinionated fetch optimized for use inside microservices. Bundles:
  • https://github.com/zeit/fetch-retry
  • https://github.com/zeit/fetch-cached-dns
  • https://github.com/node-modules/agentkeepalive

It automatically configures an agent via agentkeepalive, if not provided, with the following settings:
| Name | Value | |------------------------------|-------| | maxSockets | 200 | | maxFreeSockets | 20 | | timeout | 60000 | | freeSocketKeepAliveTimeout | 30000 |

How to use

const fetch = require('@zeit/fetch')(require('some-fetch-implementation'))

If no fetch implementation is supplied, it will attempt to use peerDep node-fetch.