diff --git a/doc/api/path.md b/doc/api/path.md index 0039e2c3ef14bd..a361877a046d09 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -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. Trailing directory separators are ignored, see +[`path.sep`][]. For example: @@ -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. Trailing directory separators are ignored, see +[`path.sep`][]. For example: @@ -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`. Trailing directory separators are ignored, +see [`path.sep`][]. The returned object will have the following properties: @@ -523,6 +526,10 @@ On Windows: // Returns: ['foo', 'bar', 'baz'] ``` +*Note*: On Windows, both the forward slash (`/`) and backward slash (`\`) are +accepted as path segment separators; however, the `path` methods only add +backward slashes (`\`). + ## path.win32