Skip to content

Repository files navigation

@turist/fetch

Opinionated fetch optimized for use inside microservices.

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

NameValue
maxSockets50
maxFreeSockets20
timeout60000
freeSocketKeepAliveTimeout30000

How to use

constfetch=require('@turist/fetch').default(require('some-fetch-implementation'))
importcreateFetchfrom'@turist/fetch';constfetch=createFetch();

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

About

Opinionated `fetch` (with retrying and DNS caching) optimized for use inside microservices

Resources

Code of conduct

Stars

23 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages