Skip to content

Commit

Permalink
doc: path functions ignore trailing slashes
Browse files Browse the repository at this point in the history
Add notes about path.parse(), path.basename() and path.dirname()
ignoring trailing slashes.

Refs: nodejs#6229
  • Loading branch information
tniessen committed Apr 3, 2017
1 parent 843b7e6 commit 96f2a34
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions doc/api/path.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ changes:
* Returns: {string}

The `path.basename()` methods returns the last portion of a `path`, similar to
the Unix `basename` command.
the Unix `basename` command. Conforming to Posix standards, trailing `/`
characters are not counted as part of the pathname.

For example:

Expand Down Expand Up @@ -128,7 +129,8 @@ changes:
* Returns: {string}

The `path.dirname()` method returns the directory name of a `path`, similar to
the Unix `dirname` command.
the Unix `dirname` command. Conforming to Posix standards, trailing `/`
characters are not counted as part of the pathname.

For example:

Expand Down Expand Up @@ -347,7 +349,8 @@ added: v0.11.15
* Returns: {Object}

The `path.parse()` method returns an object whose properties represent
significant elements of the `path`.
significant elements of the `path`. Note that trailing `/` characters are not
counted as part of the pathname and therefore ignored.

The returned object will have the following properties:

Expand Down

0 comments on commit 96f2a34

Please sign in to comment.