Skip to content

Commit 54e6a8d

Browse files
mithun-daajasnell
authored andcommitted
doc: Add windows example for Path.format
PR-URL: #5700 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
1 parent 8d39481 commit 54e6a8d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/api/path.markdown

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ and the `ext` property will be used as the `base` property.
105105

106106
Examples:
107107

108+
An example on Posix systems:
109+
108110
```js
109111
path.format({
110112
root : "/",
@@ -125,6 +127,19 @@ path.format({
125127
// returns '/file.txt'
126128
```
127129

130+
An example on Windows:
131+
132+
```js
133+
path.format({
134+
root : "C:\\",
135+
dir : "C:\\path\\dir",
136+
base : "file.txt",
137+
ext : ".txt",
138+
name : "file"
139+
})
140+
// returns 'C:\\path\\dir\\file.txt'
141+
```
142+
128143
## path.isAbsolute(path)
129144

130145
Determines whether `path` is an absolute path. An absolute path will always

0 commit comments

Comments
 (0)