1 # parse-filepath [![NPM version](https://img.shields.io/npm/v/parse-filepath.svg?style=flat)](https://www.npmjs.com/package/parse-filepath) [![NPM downloads](https://img.shields.io/npm/dm/parse-filepath.svg?style=flat)](https://npmjs.org/package/parse-filepath) [![Build Status](https://img.shields.io/travis/jonschlinkert/parse-filepath.svg?style=flat)](https://travis-ci.org/jonschlinkert/parse-filepath)
3 > Pollyfill for node.js `path.parse`, parses a filepath into an object.
5 You might also be interested in [global-prefix](https://github.com/jonschlinkert/global-prefix).
9 Install with [npm](https://www.npmjs.com/):
12 $ npm install parse-filepath --save
18 var parsePath = require('parse-filepath');
22 This can be used as a polyfill for the native node.js `path.parse()` method, and it also adds a few properties:
24 * `path`: the original filepath
25 * `isAbsolute`: (getter) true if the given path is absolute
26 * `absolute`: (getter) fully resolved, absolute filepath
27 * `dirname`: alias for `dir`
28 * `basename`: alias for `base`
29 * `extname`: alias for `ext`
30 * `stem`: alias for `name`
35 var parsePath = require('parse-filepath');
36 console.log(parsePath('foo/bar/baz/index.js'));
51 dirname: 'foo/bar/baz',
55 path: 'foo/bar/baz/index.js',
58 absolute: [Getter/Setter],
59 isAbsolute: [Getter/Setter] }
64 You might also be interested in these projects:
66 * [global-prefix](https://www.npmjs.com/package/global-prefix): Get the npm global path prefix. | [homepage](https://github.com/jonschlinkert/global-prefix)
67 * [is-absolute](https://www.npmjs.com/package/is-absolute): Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute. | [homepage](https://github.com/jonschlinkert/is-absolute)
68 * [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative)
69 * [relative](https://www.npmjs.com/package/relative): Get the relative filepath from path A to path B. Calculates from file-to-directory, file-to-file, directory-to-file,… [more](https://www.npmjs.com/package/relative) | [homepage](https://github.com/jonschlinkert/relative)
73 Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/parse-filepath/issues/new).
77 Generate readme and API documentation with [verb](https://github.com/verbose/verb):
80 $ npm install verb && npm run docs
83 Or, if [verb](https://github.com/verbose/verb) is installed globally:
91 Install dev dependencies:
94 $ npm install -d && npm test
101 * [github/jonschlinkert](https://github.com/jonschlinkert)
102 * [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
106 Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
107 Released under the [MIT license](https://github.com/jonschlinkert/parse-filepath/blob/master/LICENSE).
111 _This file was generated by [verb](https://github.com/verbose/verb), v, on March 29, 2016._