Skip to content

Commit 24feb33

Browse files
DuanPengfeiMylesBorins
authored andcommitted
doc: path.relative uses cwd
PR-URL: #13714 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 71581e9 commit 24feb33

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/api/path.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,9 @@ added: v0.5.0
426426
* `to` {string}
427427
* Returns: {string}
428428

429-
The `path.relative()` method returns the relative path from `from` to `to`.
430-
If `from` and `to` each resolve to the same path (after calling `path.resolve()`
431-
on each), a zero-length string is returned.
429+
The `path.relative()` method returns the relative path from `from` to `to` based
430+
on the current working directory. If `from` and `to` each resolve to the same
431+
path (after calling `path.resolve()` on each), a zero-length string is returned.
432432

433433
If a zero-length string is passed as `from` or `to`, the current working
434434
directory will be used instead of the zero-length strings.

0 commit comments

Comments
 (0)