From cb932835d5b511359379a5cc52b5a05668a04190 Mon Sep 17 00:00:00 2001 From: DuanPengfei <2459714173@qq.com> Date: Thu, 15 Jun 2017 23:19:16 -0400 Subject: [PATCH] doc: `path.relative` uses `cwd` PR-URL: https://github.com/nodejs/node/pull/13714 Reviewed-By: Refael Ackermann Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- doc/api/path.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/path.md b/doc/api/path.md index 34963ae5eb3ebd..a5c5af6d068704 100644 --- a/doc/api/path.md +++ b/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.