Skip to content

Commit

Permalink
doc: add explanatory to path.resolve description
Browse files Browse the repository at this point in the history
Fixes: nodejs#25542

PR-URL: nodejs#31430
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
YakovL authored and Trott committed Jan 23, 2020
1 parent 31b31a3 commit 4e3dee4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doc/api/path.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,8 @@ an absolute path.
The given sequence of paths is processed from right to left, with each
subsequent `path` prepended until an absolute path is constructed.
For instance, given the sequence of path segments: `/foo`, `/bar`, `baz`,
calling `path.resolve('/foo', '/bar', 'baz')` would return `/bar/baz`.
calling `path.resolve('/foo', '/bar', 'baz')` would return `/bar/baz`
because `'baz'` is not an absolute path but `'/bar' + '/' + 'baz'` is.

If after processing all given `path` segments an absolute path has not yet
been generated, the current working directory is used.
Expand Down

0 comments on commit 4e3dee4

Please sign in to comment.