Skip to content

BlackGlory/extra-fetch

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

extra-fetch

Install

npm install --save extra-fetch
# or
yarn add extra-fetch

API

  • fetch
  • Headers
  • Request
  • Response
  • FormData
  • AbortController
  • Blob
  • EventSource

Logging

When using fetch in Node.js, you can enable logging through the environment variable EXTRA_FETCH_LOG.

Level

  • EXTRA_FETCH_LOG=error: log ids, timestamps, elapsed time, errors on failure.
  • EXTRA_FETCH_LOG=info: log all of the above, and the urls, methods, status codes of each request and response.
  • EXTRA_FETCH_LOG=trace: log all of the above, and the headers of each request and response.