You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
871 B

4 years ago
  1. # path-parse [![Build Status](https://travis-ci.org/jbgutierrez/path-parse.svg?branch=master)](https://travis-ci.org/jbgutierrez/path-parse)
  2. > Node.js [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) [ponyfill](https://ponyfill.com).
  3. ## Install
  4. ```
  5. $ npm install --save path-parse
  6. ```
  7. ## Usage
  8. ```js
  9. var pathParse = require('path-parse');
  10. pathParse('/home/user/dir/file.txt');
  11. //=> {
  12. // root : "/",
  13. // dir : "/home/user/dir",
  14. // base : "file.txt",
  15. // ext : ".txt",
  16. // name : "file"
  17. // }
  18. ```
  19. ## API
  20. See [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) docs.
  21. ### pathParse(path)
  22. ### pathParse.posix(path)
  23. The Posix specific version.
  24. ### pathParse.win32(path)
  25. The Windows specific version.
  26. ## License
  27. MIT © [Javier Blanco](http://jbgutierrez.info)