From 24feb333c8fb20880f82076c1be559abb4bf193f 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 9d1d4ce9176a4f..5ccd5e021e5563 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -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.