doc: Add windows example for Path.format

PR-URL: https://github.com/nodejs/node/pull/5700
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
pull/5700/merge
Mithun Patel 2016-03-14 10:50:50 -05:00 committed by James M Snell
parent 8d394810e8
commit 54e6a8d6d7
1 changed files with 15 additions and 0 deletions

View File

@ -105,6 +105,8 @@ and the `ext` property will be used as the `base` property.
Examples:
An example on Posix systems:
```js
path.format({
root : "/",
@ -125,6 +127,19 @@ path.format({
// returns '/file.txt'
```
An example on Windows:
```js
path.format({
root : "C:\\",
dir : "C:\\path\\dir",
base : "file.txt",
ext : ".txt",
name : "file"
})
// returns 'C:\\path\\dir\\file.txt'
```
## path.isAbsolute(path)
Determines whether `path` is an absolute path. An absolute path will always