| 1 |
# path-parse [](https://travis-ci.org/jbgutierrez/path-parse) |
| 2 |
|
| 3 |
> Node.js [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) [ponyfill](https://ponyfill.com). |
| 4 |
|
| 5 |
## Install |
| 6 |
|
| 7 |
``` |
| 8 |
$ npm install --save path-parse |
| 9 |
``` |
| 10 |
|
| 11 |
## Usage |
| 12 |
|
| 13 |
```js |
| 14 |
var pathParse = require('path-parse'); |
| 15 |
|
| 16 |
pathParse('/home/user/dir/file.txt'); |
| 17 |
//=> { |
| 18 |
// root : "/", |
| 19 |
// dir : "/home/user/dir", |
| 20 |
// base : "file.txt", |
| 21 |
// ext : ".txt", |
| 22 |
// name : "file" |
| 23 |
// } |
| 24 |
``` |
| 25 |
|
| 26 |
## API |
| 27 |
|
| 28 |
See [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) docs. |
| 29 |
|
| 30 |
### pathParse(path) |
| 31 |
|
| 32 |
### pathParse.posix(path) |
| 33 |
|
| 34 |
The Posix specific version. |
| 35 |
|
| 36 |
### pathParse.win32(path) |
| 37 |
|
| 38 |
The Windows specific version. |
| 39 |
|
| 40 |
## License |
| 41 |
|
| 42 |
MIT © [Javier Blanco](http://jbgutierrez.info) |