| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8b53f4b commit f1a37ad
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,6 +9,9 @@ The file system is not consulted to check whether paths are valid. | |||
| 9 | 9 | Use `require('path')` to use this module. The following methods are provided: | |
| 10 | 10 | ||
| 11 | 11 | ## path.basename(p[, ext]) | |
| 12 | + <!-- YAML | ||
| 13 | + added: v0.1.25 | ||
| 14 | + --> | ||
| 12 | 15 | ||
| 13 | 16 | Return the last portion of a path. Similar to the Unix `basename` command. | |
| 14 | 17 | ||
@@ -23,6 +26,9 @@ path.basename('/foo/bar/baz/asdf/quux.html', '.html') | |||
| 23 | 26 | ``` | |
| 24 | 27 | ||
| 25 | 28 | ## path.delimiter | |
| 29 | + <!-- YAML | ||
| 30 | + added: v0.9.3 | ||
| 31 | + --> | ||
| 26 | 32 | ||
| 27 | 33 | The platform-specific path delimiter, `;` or `':'`. | |
| 28 | 34 | ||
@@ -47,6 +53,9 @@ process.env.PATH.split(path.delimiter) | |||
| 47 | 53 | ``` | |
| 48 | 54 | ||
| 49 | 55 | ## path.dirname(p) | |
| 56 | + <!-- YAML | ||
| 57 | + added: v0.1.16 | ||
| 58 | + --> | ||
| 50 | 59 | ||
| 51 | 60 | Return the directory name of a path. Similar to the Unix `dirname` command. | |
| 52 | 61 | ||
@@ -58,6 +67,9 @@ path.dirname('/foo/bar/baz/asdf/quux') | |||
| 58 | 67 | ``` | |
| 59 | 68 | ||
| 60 | 69 | ## path.extname(p) | |
| 70 | + <!-- YAML | ||
| 71 | + added: v0.1.25 | ||
| 72 | + --> | ||
| 61 | 73 | ||
| 62 | 74 | Return the extension of the path, from the last '.' to end of string | |
| 63 | 75 | in the last portion of the path. If there is no '.' in the last portion | |
@@ -82,6 +94,9 @@ path.extname('.index') | |||
| 82 | 94 | ``` | |
| 83 | 95 | ||
| 84 | 96 | ## path.format(pathObject) | |
| 97 | + <!-- YAML | ||
| 98 | + added: v0.11.15 | ||
| 99 | + --> | ||
| 85 | 100 | ||
| 86 | 101 | Returns a path string from an object, the opposite of [`path.parse`][]. | |
| 87 | 102 | ||
@@ -106,6 +121,9 @@ path.format({ | |||
| 106 | 121 | ``` | |
| 107 | 122 | ||
| 108 | 123 | ## path.isAbsolute(path) | |
| 124 | + <!-- YAML | ||
| 125 | + added: v0.11.2 | ||
| 126 | + --> | ||
| 109 | 127 | ||
| 110 | 128 | Determines whether `path` is an absolute path. An absolute path will always | |
| 111 | 129 | resolve to the same location, regardless of the working directory. | |
@@ -133,6 +151,9 @@ path.isAbsolute('.') // false | |||
| 133 | 151 | returned. | |
| 134 | 152 | ||
| 135 | 153 | ## path.join([path1][, path2][, ...]) | |
| 154 | + <!-- YAML | ||
| 155 | + added: v0.1.16 | ||
| 156 | + --> | ||
| 136 | 157 | ||
| 137 | 158 | Join all arguments together and normalize the resulting path. | |
| 138 | 159 | ||
@@ -156,6 +177,9 @@ TypeError: Arguments to path.join must be strings | |||
| 156 | 177 | current working directory. | |
| 157 | 178 | ||
| 158 | 179 | ## path.normalize(p) | |
| 180 | + <!-- YAML | ||
| 181 | + added: v0.1.23 | ||
| 182 | + --> | ||
| 159 | 183 | ||
| 160 | 184 | Normalize a string path, taking care of `'..'` and `'.'` parts. | |
| 161 | 185 | ||
@@ -174,6 +198,9 @@ path.normalize('/foo/bar//baz/asdf/quux/..') | |||
| 174 | 198 | will be returned, which represents the current working directory. | |
| 175 | 199 | ||
| 176 | 200 | ## path.parse(pathString) | |
| 201 | + <!-- YAML | ||
| 202 | + added: v0.11.15 | ||
| 203 | + --> | ||
| 177 | 204 | ||
| 178 | 205 | Returns an object from a path string. | |
| 179 | 206 | ||
@@ -206,11 +233,17 @@ path.parse('C:\\path\\dir\\index.html') | |||
| 206 | 233 | ``` | |
| 207 | 234 | ||
| 208 | 235 | ## path.posix | |
| 236 | + <!-- YAML | ||
| 237 | + added: v0.11.15 | ||
| 238 | + --> | ||
| 209 | 239 | ||
| 210 | 240 | Provide access to aforementioned `path` methods but always interact in a posix | |
| 211 | 241 | compatible way. | |
| 212 | 242 | ||
| 213 | 243 | ## path.relative(from, to) | |
| 244 | + <!-- YAML | ||
| 245 | + added: v0.5.0 | ||
| 246 | + --> | ||
| 214 | 247 | ||
| 215 | 248 | Solve the relative path from `from` to `to`. | |
| 216 | 249 | ||
@@ -237,6 +270,9 @@ path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb') | |||
| 237 | 270 | both the paths are the same then a zero-length string will be returned. | |
| 238 | 271 | ||
| 239 | 272 | ## path.resolve([from ...], to) | |
| 273 | + <!-- YAML | ||
| 274 | + added: v0.3.4 | ||
| 275 | + --> | ||
| 240 | 276 | ||
| 241 | 277 | Resolves `to` to an absolute path. | |
| 242 | 278 | ||
@@ -283,6 +319,9 @@ path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif') | |||
| 283 | 319 | working directory will be used instead of them. | |
| 284 | 320 | ||
| 285 | 321 | ## path.sep | |
| 322 | + <!-- YAML | ||
| 323 | + added: v0.7.9 | ||
| 324 | + --> | ||
| 286 | 325 | ||
| 287 | 326 | The platform-specific file separator. `'\\'` or `'/'`. | |
| 288 | 327 | ||
@@ -301,6 +340,9 @@ An example on Windows: | |||
| 301 | 340 | ``` | |
| 302 | 341 | ||
| 303 | 342 | ## path.win32 | |
| 343 | + <!-- YAML | ||
| 344 | + added: v0.11.15 | ||
| 345 | + --> | ||
| 304 | 346 | ||
| 305 | 347 | Provide access to aforementioned `path` methods but always interact in a win32 | |
| 306 | 348 | compatible way. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments