JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7102412
  • Score
    100M100P100Q220594F
  • License MIT

Parse a filepath into an object. Falls back on the native node.js `path.parse` method if it exists.

Package Exports

  • parse-filepath

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (parse-filepath) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

parse-filepath NPM version

Parse a filepath into an object. Falls back on the native node.js path.parse method if it exists.

Install with npm

$ npm i parse-filepath --save

Usage

var parsePath = require('parse-filepath');
parsePath('foo/bar/baz/index.html');

Returns:

{ path: 'foo/bar/baz/index.html',
  isAbsolute: false,
  absolute: '/Users/jonschlinkert/dev/parse-filepath/foo/bar/baz/index.html',
  root: '',
  dirname: 'foo/bar/baz',
  basename: 'index.html',
  extname: '.html',
  name: 'index' }
  • cwd: Easily get the CWD (current working directory) of a project based on package.json, optionally starting… more
  • global-prefix: Get the npm global path prefix.
  • is-absolute: Return true if a file path is absolute.
  • is-relative: Returns true if the path appears to be relative.
  • relative: Get the relative filepath from path A to path B. Calculates from file-to-directory, file-to-file, directory-to-file,… more

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright © 2014-2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on July 29, 2015.