Skip to content
Permalink
Browse files
doc: path.relative uses cwd
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 refack committed Jun 19, 2017
1 parent aaa80df commit 6e69421e53c4e7969202464ff1f2654a50443988
Showing with 3 additions and 3 deletions.
  1. +3 −3 doc/api/path.md
@@ -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.

0 comments on commit 6e69421

Please sign in to comment.