@@ -22,6 +22,9 @@ Example: |
22 | 22 | // returns |
23 | 23 | '/foo/bar/baz/asdf' |
24 | 24 |
|
| 25 | +*Note:* If the path string passed as argument is a zero-length string then `'.'` |
| 26 | + will be returned, which represents the current working directory. |
| 27 | + |
25 | 28 | ## path.join([path1][, path2][, ...]) |
26 | 29 |
|
27 | 30 | Join all arguments together and normalize the resulting path. |
@@ -39,6 +42,11 @@ Example: |
39 | 42 | // throws exception |
40 | 43 | TypeError: Arguments to path.join must be strings |
41 | 44 |
|
| 45 | +*Note:* If the arguments to `join` have zero-length strings, unlike other path |
| 46 | + module functions, they will be ignored. If the joined path string is a |
| 47 | + zero-length string then `'.'` will be returned, which represents the |
| 48 | + current working directory. |
| 49 | + |
42 | 50 | ## path.resolve([from ...], to) |
43 | 51 |
|
44 | 52 | Resolves `to` to an absolute path. |
@@ -78,6 +86,9 @@ Examples: |
78 | 86 | // if currently in /home/myself/iojs, it returns |
79 | 87 | '/home/myself/iojs/wwwroot/static_files/gif/image.gif' |
80 | 88 |
|
| 89 | +*Note:* If the arguments to `resolve` have zero-length strings then the current |
| 90 | + working directory will be used instead of them. |
| 91 | + |
81 | 92 | ## path.isAbsolute(path) |
82 | 93 |
|
83 | 94 | Determines whether `path` is an absolute path. An absolute path will always |
@@ -94,9 +105,13 @@ Windows examples: |
94 | 105 |
|
95 | 106 | path.isAbsolute('//server') // true |
96 | 107 | path.isAbsolute('C:/foo/..') // true |
97 | | - path.isAbsolute('bar\\baz') // false |
| 108 | + path.isAbsolute('bar\\baz') // false |
98 | 109 | path.isAbsolute('.') // false |
99 | 110 |
|
| 111 | +*Note:* If the path string passed as parameter is a zero-length string, unlike |
| 112 | + other path module functions, it will be used as-is and `false` will be |
| 113 | + returned. |
| 114 | + |
100 | 115 | ## path.relative(from, to) |
101 | 116 |
|
102 | 117 | Solve the relative path from `from` to `to`. |
@@ -117,6 +132,10 @@ Examples: |
117 | 132 | // returns |
118 | 133 | '../../impl/bbb' |
119 | 134 |
|
| 135 | +*Note:* If the arguments to `relative` have zero-length strings then the current |
| 136 | + working directory will be used instead of the zero-length strings. If |
| 137 | + both the paths are the same then a zero-length string will be returned. |
| 138 | + |
120 | 139 | ## path.dirname(p) |
121 | 140 |
|
122 | 141 | Return the directory name of a path. Similar to the Unix `dirname` command. |
|