doc: path.relative uses cwd

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
DuanPengfei authored and Myles Borins committed 2017-07-17 14:40:21 -04:00
1 parent 71581e9308
commit 24feb333c8
1 file changed
+3 -3
+3 -3
View File
@@ -426,9 +426,9 @@ added: v0.5.0
* `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.