Debug
Undici (and subsenquently fetch and websocket) exposes a debug statement that can be enabled by setting NODE_DEBUG within the environment.
The flags available are:
undici
undiciThis flag enables debug statements for the core undici library.
NODE_DEBUG=undici node script.js
UNDICI 16241: connecting to nodejs.org using https:h1
UNDICI 16241: connecting to nodejs.org using https:h1
UNDICI 16241: connected to nodejs.org using https:h1
UNDICI 16241: sending request to GET https://nodejs.org/
UNDICI 16241: received response to GET https://nodejs.org/ - HTTP 307
UNDICI 16241: connecting to nodejs.org using https:h1
UNDICI 16241: trailers received from GET https://nodejs.org/
UNDICI 16241: connected to nodejs.org using https:h1
UNDICI 16241: sending request to GET https://nodejs.org/en
UNDICI 16241: received response to GET https://nodejs.org/en - HTTP 200
UNDICI 16241: trailers received from GET https://nodejs.org/enfetch
fetchThis flag enables debug statements for the fetch API.
Note: statements are pretty similar to the ones in the
undiciflag, but scoped tofetch
websocket
websocketThis flag enables debug statements for the Websocket API.
Note: statements can overlap with
UNDICIones ifundiciorfetchflag has been enabled as well.
Last updated