Skip to content

Commit a7c85e6

Browse files
julianduqueevanlucas
authored andcommitted
doc: add added: information for path
Got the information from git history mostly, I ignored previous path methods attached to `node.path` (pre v0.1.16). Refs: #6578 PR-URL: #6985 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 026bf17 commit a7c85e6

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

doc/api/path.md

+42
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ paths. The file system is not consulted to check whether paths are valid.
88
Use `require('path')` to use this module. The following methods are provided:
99

1010
## path.basename(path[, ext])
11+
<!-- YAML
12+
added: v0.1.25
13+
-->
1114

1215
Return the last portion of a path, similar to the Unix `basename` command.
1316
`path` must be a string. `ext`, if given, must also be a string.
@@ -23,6 +26,9 @@ path.basename('/foo/bar/baz/asdf/quux.html', '.html')
2326
```
2427

2528
## path.delimiter
29+
<!-- YAML
30+
added: v0.9.3
31+
-->
2632

2733
The platform-specific path delimiter, `;` or `':'`.
2834

@@ -47,6 +53,9 @@ process.env.PATH.split(path.delimiter)
4753
```
4854

4955
## path.dirname(path)
56+
<!-- YAML
57+
added: v0.1.16
58+
-->
5059

5160
Return the directory name of a path, similar to the Unix `dirname` command.
5261
`path` must be a string.
@@ -59,6 +68,9 @@ path.dirname('/foo/bar/baz/asdf/quux')
5968
```
6069

6170
## path.extname(path)
71+
<!-- YAML
72+
added: v0.1.25
73+
-->
6274

6375
Return the extension of the path, from the last '.' to end of string
6476
in the last portion of the path. If there is no '.' in the last portion
@@ -85,6 +97,9 @@ path.extname('.index')
8597
```
8698

8799
## path.format(pathObject)
100+
<!-- YAML
101+
added: v0.11.15
102+
-->
88103

89104
Returns a path string from an object. This is the opposite of [`path.parse`][].
90105

@@ -154,6 +169,9 @@ path.format({
154169
```
155170

156171
## path.isAbsolute(path)
172+
<!-- YAML
173+
added: v0.11.2
174+
-->
157175

158176
Determines whether `path` is an absolute path. An absolute path will always
159177
resolve to the same location, regardless of the working directory. `path` must
@@ -182,6 +200,9 @@ path.isAbsolute('.') // false
182200
returned.
183201

184202
## path.join([path1][, path2][, ...])
203+
<!-- YAML
204+
added: v0.1.16
205+
-->
185206

186207
Join all arguments together and normalize the resulting path.
187208

@@ -205,6 +226,9 @@ TypeError: Arguments to path.join must be strings
205226
current working directory.
206227

207228
## path.normalize(path)
229+
<!-- YAML
230+
added: v0.1.23
231+
-->
208232

209233
Normalize a path, taking care of `'..'` and `'.'` parts. `path` must be a
210234
string.
@@ -224,6 +248,9 @@ path.normalize('/foo/bar//baz/asdf/quux/..')
224248
will be returned, which represents the current working directory.
225249

226250
## path.parse(path)
251+
<!-- YAML
252+
added: v0.11.15
253+
-->
227254

228255
Returns an object from a path. `path` must be a string.
229256

@@ -256,11 +283,17 @@ path.parse('C:\\path\\dir\\index.html')
256283
```
257284

258285
## path.posix
286+
<!-- YAML
287+
added: v0.11.15
288+
-->
259289

260290
Provide access to aforementioned `path` methods but always interact in a posix
261291
compatible way.
262292

263293
## path.relative(from, to)
294+
<!-- YAML
295+
added: v0.5.0
296+
-->
264297

265298
Solve the relative path from `from` to `to`. `from` and `to` must be strings.
266299

@@ -287,6 +320,9 @@ path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb')
287320
both the paths are the same then a zero-length string will be returned.
288321

289322
## path.resolve([from ...], to)
323+
<!-- YAML
324+
added: v0.3.4
325+
-->
290326

291327
Resolves `to` to an absolute path. All arguments must be strings.
292328

@@ -331,6 +367,9 @@ path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif')
331367
```
332368

333369
## path.sep
370+
<!-- YAML
371+
added: v0.7.9
372+
-->
334373

335374
The platform-specific file separator. `'\\'` or `'/'`.
336375

@@ -349,6 +388,9 @@ An example on Windows:
349388
```
350389

351390
## path.win32
391+
<!-- YAML
392+
added: v0.11.15
393+
-->
352394

353395
Provide access to aforementioned `path` methods but always interact in a win32
354396
compatible way.

0 commit comments

Comments
 (0)