Skip to content

Improve documentation to make all information available in a single view #2208

Closed

Description

@Raynos

This would solve...

I found it challenging to navigate the documentation and understand how to do things like

  • What are all the options available to request()
  • I have an old legacy streams1 package, how do I create a req instance and do oldstream.pipe(req) to write the HTTP body

The implementation should look like...

https://github.com/request/request#requestoptions-callback

I have also considered...

Not using undici, and using another package with a more user friendly README

Additional context

All the documentation is there, I just have to click around and read multiple pages and multiple sections and its very confusing,

Activity

  1. mcollina commented on Aug 3, 2023

    @mcollina
    SponsorMember

    A massive overhaul of our docs is welcomed, but at this point it seems a stretch for the current team. I would love if somebody volunteered for this effort.

  2. added
    DocsChanges related to the documentation
    on Aug 24, 2024
  3. AliMahmoudDev commented on Jun 6, 2026

    @AliMahmoudDev
    Contributor

    One thing that helped me a lot when getting started with undici was the typed options in the source code itself — each class has JSDoc types that list all available options with defaults. For example, new Pool(url, options) has PoolOptions which documents every field.

    As a quick reference, the high-level mapping is:

    • fetch() wraps Client.request(), options are mostly the same plus a few extras
    • request() / stream() are direct Dispatcher methods
    • Pool / Agent handle connection management with PoolOptions and AgentOptions
    • Timeouts: connectTimeout, headersTimeout, bodyTimeout, keepAliveTimeout

    A getting started page that maps common use cases (basic fetch, streaming, custom dispatcher, mocking) to the relevant API surface would go a long way. Happy to draft something if there is interest.

  4. mcollina commented on Jun 6, 2026

    @mcollina
    SponsorMember

    Absolutely! Go for it!

  5. AliMahmoudDev commented on Jun 6, 2026

    @AliMahmoudDev
    Contributor

    thanks, will start putting together a PR.

  6. AliMahmoudDev commented on Jun 6, 2026

    @AliMahmoudDev
    Contributor

    opened a draft PR for a getting started guide -- #5371. covers fetch/request/stream/pipeline, dispatcher selection, timeouts, error handling, and links to the relevant api pages. lmk if the scope/direction looks right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsChanges related to the documentationStatus: help-wantedThis issue/pr is open for contributionsenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions