Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Clarify undici module vs fetch in Node #4066

Open
rkdefra opened this issue Feb 24, 2025 · 3 comments
Open

Docs: Clarify undici module vs fetch in Node #4066

rkdefra opened this issue Feb 24, 2025 · 3 comments
Labels
Docs Changes related to the documentation good first issue Good for newcomers

Comments

@rkdefra
Copy link

rkdefra commented Feb 24, 2025

Why install undici if it's included in Node

It would be REALLY useful to explain the differences between undici as a module vs the parts included in Node. Generally I understand that the fetch API is included in Node from v20 or so - and that the undici version included in Node can be determined from the value process.versions.undici - but beyond this not much.
It would also be very useful to have something that explains when you should install undici as a module, rather than just using the Node internal, e.g.

  • you want to use a specific version of undici
  • you require APIs that aren't available in Node, i.e. ProxyAgent?, and presumably others?

Please include something along these lines in your docs (preferably somewhere near the top, or at least link it there).

@rkdefra rkdefra added the enhancement New feature or request label Feb 24, 2025
@metcoder95
Copy link
Member

I believe it can be good to outline possible situations where is better to use undici's APIs rather than fetch directly.

Would you like to send a PR addressing that?

@metcoder95 metcoder95 added Docs Changes related to the documentation and removed enhancement New feature or request labels Feb 25, 2025
@rkdefra
Copy link
Author

rkdefra commented Feb 26, 2025

I believe it can be good to outline possible situations where is better to use undici's APIs rather than fetch directly.

Would you like to send a PR addressing that?

I'm afraid I do not posses the intimate knowledge of undici required to write authoritative documentation on its intended use. I was rather hoping someone on this project could do that.
I've checked the Node docs and there's very little in there! Only a passing mention to undici in the output of require('node:process').versions, and a section introducing the fetch API that quickly starts to mention importing undici components even though there's no mention of having to install the module first 😞

@metcoder95
Copy link
Member

We can help you go through it to develop it, that's not an issue (in case you are interested)

@metcoder95 metcoder95 added the good first issue Good for newcomers label Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Changes related to the documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants