join
function join(...paths: string[]): string;
Empty segments are dropped, doubled separators collapse into one, and the result is normalised afterwards — so a .. written mid-path is resolved rather than carried along.
This is string work, not filesystem work: nothing is checked for existence.
Parameters
Parameter | Type | Description |
|---|---|---|
|
| The segments to join. |
Returns
string — the joined, normalised path.
Examples
Joining
join("a", "b/c"); // => "a/b/c"
join("a", "", "b"); // => "a/b"
join("/a", "../b"); // => "/b"
See also
Source
23 September 2026
This documentation was generated with AI (Claude) from the library's source code.