{"id":15652854,"url":"https://github.com/jonschlinkert/parse-filepath","last_synced_at":"2025-06-15T20:43:52.239Z","repository":{"id":16542247,"uuid":"19295780","full_name":"jonschlinkert/parse-filepath","owner":"jonschlinkert","description":"Parse a filepath and return an object of path parts. Falls back on native node.js `path.parse` if it exists ","archived":false,"fork":false,"pushed_at":"2017-12-19T23:25:47.000Z","size":37,"stargazers_count":30,"open_issues_count":1,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-07T15:07:20.396Z","etag":null,"topics":["file","filepath","javascript","node","nodejs","parse","path"],"latest_commit_sha":null,"homepage":"https://github.com/jonschlinkert","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-30T00:19:40.000Z","updated_at":"2024-08-05T03:17:50.000Z","dependencies_parsed_at":"2022-08-26T01:10:23.088Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/parse-filepath","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fparse-filepath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fparse-filepath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fparse-filepath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fparse-filepath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/parse-filepath/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252902614,"owners_count":21822261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["file","filepath","javascript","node","nodejs","parse","path"],"created_at":"2024-10-03T12:44:04.569Z","updated_at":"2025-05-07T15:07:41.633Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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)\n\n\u003e Pollyfill for node.js `path.parse`, parses a filepath into an object.\n\nYou might also be interested in [global-prefix](https://github.com/jonschlinkert/global-prefix).\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install parse-filepath --save\n```\n\n## Usage\n\n```js\nvar parsePath = require('parse-filepath');\nparsePath(filepath);\n```\n\nThis can be used as a polyfill for the native node.js `path.parse()` method, and it also adds a few properties:\n\n* `path`: the original filepath\n* `isAbsolute`: (getter) true if the given path is absolute\n* `absolute`: (getter) fully resolved, absolute filepath\n* `dirname`: alias for `dir`\n* `basename`: alias for `base`\n* `extname`: alias for `ext`\n* `stem`: alias for `name`\n\n**Example**\n\n```js\nvar parsePath = require('parse-filepath');\nconsole.log(parsePath('foo/bar/baz/index.js'));\n```\n\nReturns:\n\n```js\n{ root: '',\n  dir: 'foo/bar/baz',\n  base: 'index.js',\n  ext: '.js',\n  name: 'index',\n\n  // aliases\n  extname: '.js',\n  basename: 'index.js',\n  dirname: 'foo/bar/baz',\n  stem: 'index',\n\n  // original path\n  path: 'foo/bar/baz/index.js',\n\n  // getters\n  absolute: [Getter/Setter],\n  isAbsolute: [Getter/Setter] }\n```\n\n## Related projects\n\nYou might also be interested in these projects:\n\n* [global-prefix](https://www.npmjs.com/package/global-prefix): Get the npm global path prefix. | [homepage](https://github.com/jonschlinkert/global-prefix)\n* [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)\n* [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)\n* [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)\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/parse-filepath/issues/new).\n\n## Building docs\n\nGenerate readme and API documentation with [verb](https://github.com/verbose/verb):\n\n```sh\n$ npm install verb \u0026\u0026 npm run docs\n```\n\nOr, if [verb](https://github.com/verbose/verb) is installed globally:\n\n```sh\n$ verb\n```\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm install -d \u0026\u0026 npm test\n```\n\n## Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n## License\n\nCopyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT license](https://github.com/jonschlinkert/parse-filepath/blob/master/LICENSE).\n\n***\n\n_This file was generated by [verb](https://github.com/verbose/verb), v, on March 29, 2016._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fparse-filepath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fparse-filepath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fparse-filepath/lists"}