@@ -64,7 +64,8 @@ added: v0.1.25
64
64
* Returns: {String}
65
65
66
66
The ` path.basename() ` methods returns the last portion of a ` path ` , similar to
67
- the Unix ` basename ` command.
67
+ the Unix ` basename ` command. Trailing directory separators are ignored, see
68
+ [ ` path.sep ` ] [ ] .
68
69
69
70
For example:
70
71
@@ -120,7 +121,8 @@ added: v0.1.16
120
121
* Returns: {String}
121
122
122
123
The ` path.dirname() ` method returns the directory name of a ` path ` , similar to
123
- the Unix ` dirname ` command.
124
+ the Unix ` dirname ` command. Trailing directory separators are ignored, see
125
+ [ ` path.sep ` ] [ ] .
124
126
125
127
For example:
126
128
@@ -335,7 +337,8 @@ added: v0.11.15
335
337
* Returns: {Object}
336
338
337
339
The ` path.parse() ` method returns an object whose properties represent
338
- significant elements of the ` path ` .
340
+ significant elements of the ` path ` . Trailing directory separators are ignored,
341
+ see [ ` path.sep ` ] [ ] .
339
342
340
343
The returned object will have the following properties:
341
344
@@ -506,6 +509,10 @@ On Windows:
506
509
// Returns: ['foo', 'bar', 'baz']
507
510
```
508
511
512
+ * Note* : On Windows, both the forward slash (` / ` ) and backward slash (` \ ` ) are
513
+ accepted as path segment separators; however, the ` path ` methods only add
514
+ backward slashes (` \ ` ).
515
+
509
516
## path.win32
510
517
<!-- YAML
511
518
added: v0.11.15
@@ -516,11 +523,8 @@ added: v0.11.15
516
523
The ` path.win32 ` property provides access to Windows-specific implementations
517
524
of the ` path ` methods.
518
525
519
- * Note* : On Windows, both the forward slash (` / ` ) and backward slash (` \ ` )
520
- characters are accepted as path delimiters; however, only the backward slash
521
- (` \ ` ) will be used in return values.
522
-
523
526
[ `path.posix` ] : #path_path_posix
527
+ [ `path.sep` ] : #path_path_sep
524
528
[ `path.win32` ] : #path_path_win32
525
529
[ `path.parse()` ] : #path_path_parse_path
526
530
[ `TypeError` ] : errors.html#errors_class_typeerror
0 commit comments