Opinionated `fetch` optimized for use inside microservices

Usage no npm install needed!

<script type="module">
  import vercelFetch from 'https://cdn.skypack.dev/@vercel/fetch';



Build Status

Opinionated fetch optimized for use inside microservices. Bundles:

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('@vercel/fetch')(require('some-fetch-implementation'));


import createFetch from '@vercel/fetch';
import * as fetch from 'some-fetch-implementation';
const fetch = createFetch(fetch);

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