Gathering detailed insights and metrics for parse-filepath
Gathering detailed insights and metrics for parse-filepath
Gathering detailed insights and metrics for parse-filepath
Gathering detailed insights and metrics for parse-filepath
Parse a filepath and return an object of path parts. Falls back on native node.js `path.parse` if it exists
npm install parse-filepath
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
30 Stars
46 Commits
6 Forks
4 Watching
1 Branches
3 Contributors
Updated on 05 Aug 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-7.8%
1,048,263
Compared to previous day
Last week
2.3%
6,083,033
Compared to previous week
Last month
10.9%
24,906,547
Compared to previous month
Last year
11.9%
266,453,982
Compared to previous year
3
3
Pollyfill for node.js
path.parse
, parses a filepath into an object.
You might also be interested in global-prefix.
Install with npm:
1$ npm install parse-filepath --save
1var parsePath = require('parse-filepath'); 2parsePath(filepath);
This can be used as a polyfill for the native node.js path.parse()
method, and it also adds a few properties:
path
: the original filepathisAbsolute
: (getter) true if the given path is absoluteabsolute
: (getter) fully resolved, absolute filepathdirname
: alias for dir
basename
: alias for base
extname
: alias for ext
stem
: alias for name
Example
1var parsePath = require('parse-filepath'); 2console.log(parsePath('foo/bar/baz/index.js'));
Returns:
1{ root: '', 2 dir: 'foo/bar/baz', 3 base: 'index.js', 4 ext: '.js', 5 name: 'index', 6 7 // aliases 8 extname: '.js', 9 basename: 'index.js', 10 dirname: 'foo/bar/baz', 11 stem: 'index', 12 13 // original path 14 path: 'foo/bar/baz/index.js', 15 16 // getters 17 absolute: [Getter/Setter], 18 isAbsolute: [Getter/Setter] }
You might also be interested in these projects:
path.isAbolute
. Returns true if a file path is absolute. | homepagetrue
if the path appears to be relative. | homepagePull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Generate readme and API documentation with verb:
1$ npm install verb && npm run docs
Or, if verb is installed globally:
1$ verb
Install dev dependencies:
1$ npm install -d && npm test
Jon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v, on March 29, 2016.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/24 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More