docs: improve connect option documentation in Client.md#5344
Open
AliMahmoudDev wants to merge 1 commit into
Open
docs: improve connect option documentation in Client.md#5344AliMahmoudDev wants to merge 1 commit into
AliMahmoudDev wants to merge 1 commit into
Conversation
- Add description for connect option explaining both object and function forms - Document the function signature (options, callback) with fields - Document the wrapping behavior (socketPath/allowH2 injection) - Add example: Connect with TLS options (object form) - Add example: Connect via Unix domain socket - Improve custom connector example with note about wrapping - Add cross-reference to Connector.md for buildConnector Partially addresses nodejs#886
metcoder95
approved these changes
Jun 3, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5344 +/- ##
==========================================
+ Coverage 93.22% 93.23% +0.01%
==========================================
Files 110 110
Lines 36668 36668
==========================================
+ Hits 34185 34189 +4
+ Misses 2483 2479 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves the
connectoption documentation inClient.mdto address the lack of description for one of the most important configuration options.Problem
The
connectoption inClientOptionswas documented as:This had no description at all — just a type signature and default value. Users had no guidance on:
buildConnector())hostname,host,protocol,port,servername,localAddress,httpSocket)socketPathandallowH2Changes
Added description for
connectparameter (lines 30-32):ConnectOptions→ forwarded tobuildConnector()) and function form (custom connector)(options, callback)whereoptionscontains{ hostname, host, protocol, port, servername, localAddress, httpSocket }andcallbackfollows(error, socket)socketPathandallowH2into options when a function is providedbuildConnector()andConnectOptionsAdded example: Connect with TLS options (object form) — shows passing
rejectUnauthorizedandcaas aConnectOptionsobjectAdded example: Connect via Unix domain socket — shows using
socketPathfor IPC connections (e.g., Docker socket)Improved custom connector example — renamed from "Custom connector" to "Custom connector (function form)", added a note callout explaining the wrapping behavior, and added a cross-reference to
Connector.mdFiles changed
docs/docs/api/Client.mdPartially addresses #886