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

7.2.0 • Public • Published

@turist/fetch

Opinionated fetch optimized for use inside microservices.

It automatically configures an agent via agentkeepalive, if not provided, with the following settings:

Name Value
maxSockets 50
maxFreeSockets 20
timeout 60000
freeSocketKeepAliveTimeout 30000

How to use

const fetch = require('@turist/fetch').default(require('some-fetch-implementation'))
import createFetch from '@turist/fetch';

const fetch = createFetch();

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

Readme

Keywords

none

Package Sidebar

Install

npm i @turist/fetch

Weekly Downloads

294,640

Version

7.2.0

License

MIT

Unpacked Size

759 kB

Total Files

15

Last publish

Collaborators

  • olliv
  • jamo