Browse Source

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>
v6
DuanPengfei 8 years ago
committed by Refael Ackermann
parent
commit
6e69421e53
  1. 6
      doc/api/path.md

6
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.

Loading…
Cancel
Save