Skip to content

Commit

Permalink
doc: path.relative uses cwd
Browse files Browse the repository at this point in the history
PR-URL: #13714
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
DuanPengfei authored and addaleax committed Jun 21, 2017
1 parent d0f39cc commit cb93283
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/api/path.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,9 @@ changes:
* `to` {string}
* Returns: {string}

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

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

0 comments on commit cb93283

Please sign in to comment.