New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

parse-filepath

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-filepath

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

  • 0.6.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.4M
decreased by-16.88%
Maintainers
2
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 29 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc