@vercel/fetch
TypeScript icon, indicating that this package has built-in type declarations

7.0.0 • Public • Published

@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

JavaScript

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

TypeScript

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.

/@vercel/fetch/

    Package Sidebar

    Install

    npm i @vercel/fetch

    Weekly Downloads

    122,302

    Version

    7.0.0

    License

    MIT

    Unpacked Size

    8.12 kB

    Total Files

    5

    Last publish

    Collaborators

    • matt.straka
    • ijjk
    • quietshu
    • vercel-release-bot
    • snokohn
    • nick.tracey
    • matheuss
    • chriswdmr
    • zeit-bot