Skip to content

Commit

Permalink
doc: Add windows example for Path.format
Browse files Browse the repository at this point in the history
PR-URL: #5700
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
  • Loading branch information
mithun-daa authored and Myles Borins committed Mar 30, 2016
1 parent 78effc3 commit bf1fe46
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions doc/api/path.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ string will be the contents of the `base` property.
If the `base` property is not supplied, a concatenation of the `name` property
and the `ext` property will be used as the `base` property.

Examples:

An example on Posix systems:

```js
path.format({
root : "/",
Expand All @@ -120,6 +124,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
Expand Down

0 comments on commit bf1fe46

Please sign in to comment.