@@ -68,7 +68,8 @@ changes:
68
68
* Returns: {string}
69
69
70
70
The ` path.basename() ` methods returns the last portion of a ` path ` , similar to
71
- the Unix ` basename ` command.
71
+ the Unix ` basename ` command. Trailing directory separators are ignored, see
72
+ [ ` path.sep ` ] [ ] .
72
73
73
74
For example:
74
75
@@ -128,7 +129,8 @@ changes:
128
129
* Returns: {string}
129
130
130
131
The ` path.dirname() ` method returns the directory name of a ` path ` , similar to
131
- the Unix ` dirname ` command.
132
+ the Unix ` dirname ` command. Trailing directory separators are ignored, see
133
+ [ ` path.sep ` ] [ ] .
132
134
133
135
For example:
134
136
@@ -347,7 +349,8 @@ added: v0.11.15
347
349
* Returns: {Object}
348
350
349
351
The ` path.parse() ` method returns an object whose properties represent
350
- significant elements of the ` path ` .
352
+ significant elements of the ` path ` . Trailing directory separators are ignored,
353
+ see [ ` path.sep ` ] [ ] .
351
354
352
355
The returned object will have the following properties:
353
356
@@ -519,6 +522,10 @@ On Windows:
519
522
// Returns: ['foo', 'bar', 'baz']
520
523
```
521
524
525
+ * Note* : On Windows, both the forward slash (` / ` ) and backward slash (` \ ` ) are
526
+ accepted as path segment separators; however, the ` path ` methods only add
527
+ backward slashes (` \ ` ).
528
+
522
529
## path.win32
523
530
<!-- YAML
524
531
added: v0.11.15
@@ -529,11 +536,8 @@ added: v0.11.15
529
536
The ` path.win32 ` property provides access to Windows-specific implementations
530
537
of the ` path ` methods.
531
538
532
- * Note* : On Windows, both the forward slash (` / ` ) and backward slash (` \ ` )
533
- characters are accepted as path delimiters; however, only the backward slash
534
- (` \ ` ) will be used in return values.
535
-
536
539
[ `path.posix` ] : #path_path_posix
540
+ [ `path.sep` ] : #path_path_sep
537
541
[ `path.win32` ] : #path_path_win32
538
542
[ `path.parse()` ] : #path_path_parse_path
539
543
[ `TypeError` ] : errors.html#errors_class_typeerror
0 commit comments