JSPM

@vercel/fetch

7.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 434563
  • Score
    100M100P100Q174393F
  • License MIT

Opinionated `fetch` optimized for use inside microservices

Package Exports

  • @vercel/fetch
  • @vercel/fetch/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@vercel/fetch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@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.