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>

Conflicts:
	doc/api/path.markdown
  • Loading branch information
mithun-daa authored and Fishrock123 committed Mar 22, 2016
1 parent d2fa644 commit 0ffd794
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions doc/api/path.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ 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.

An example on Posix systems:

```js
path.format({
root : "/",
Expand All @@ -111,6 +113,19 @@ path.format({
// returns '/home/user/dir/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 0ffd794

Please sign in to comment.