Skip to content

Commit 0ffd794

Browse files
mithun-daaFishrock123
authored andcommittedMar 22, 2016
doc: Add windows example for Path.format
PR-URL: #5700 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Conflicts: doc/api/path.markdown
1 parent d2fa644 commit 0ffd794

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
 

‎doc/api/path.markdown

+15
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ string will be the contents of the `base` property.
100100
If the `base` property is not supplied, a concatenation of the `name` property
101101
and the `ext` property will be used as the `base` property.
102102

103+
An example on Posix systems:
104+
103105
```js
104106
path.format({
105107
root : "/",
@@ -111,6 +113,19 @@ path.format({
111113
// returns '/home/user/dir/file.txt'
112114
```
113115

116+
An example on Windows:
117+
118+
```js
119+
path.format({
120+
root : "C:\\",
121+
dir : "C:\\path\\dir",
122+
base : "file.txt",
123+
ext : ".txt",
124+
name : "file"
125+
})
126+
// returns 'C:\\path\\dir\\file.txt'
127+
```
128+
114129
## path.isAbsolute(path)
115130

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

0 commit comments

Comments
 (0)
Please sign in to comment.