Returns true if a filepath is absolute. The original path-is-absolute.
Installations
npm install is-absolute
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=0.10.0
Node Version
7.7.3
NPM Version
5.2.0
Score
99.3
Supply Chain
98.3
Quality
77.5
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
Download Statistics
Total Downloads
1,593,969,854
Last Day
1,217,867
Last Week
6,049,296
Last Month
20,491,009
Last Year
310,526,002
GitHub Statistics
22 Stars
41 Commits
4 Forks
4 Watching
1 Branches
5 Contributors
Bundle Size
1.16 kB
Minified
534.00 B
Minified + Gzipped
Package Meta Information
Latest Version
1.0.0
Package Id
is-absolute@1.0.0
Size
3.21 kB
NPM Version
5.2.0
Node Version
7.7.3
Publised On
13 Jul 2017
Total Downloads
Cumulative downloads
Total Downloads
1,593,969,854
Last day
5.4%
1,217,867
Compared to previous day
Last week
1.7%
6,049,296
Compared to previous week
Last month
-21.4%
20,491,009
Compared to previous month
Last year
8.2%
310,526,002
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
Dev Dependencies
2
is-absolute
Returns true if a file path is absolute. Does not rely on the path module and can be used as a polyfill for node.js native
path.isAbolute
.
Install
Install with npm:
1$ npm install --save is-absolute
Originally based on the isAbsolute
utility method in express.
Usage
1var isAbsolute = require('is-absolute'); 2 3isAbsolute('a/b/c.js'); 4//=> 'false' 5isAbsolute('/a/b/c.js'); 6//=> 'true'
Explicitly test windows paths
1isAbsolute.posix('/foo/bar'); 2isAbsolute.posix('/user/docs/Letter.txt'); 3//=> true 4 5isAbsolute.posix('foo/bar'); 6//=> false
Explicitly test windows paths
1var isAbsolute = require('is-absolute'); 2 3isAbsolute.win32('c:\\'); 4isAbsolute.win32('//C://user\\docs\\Letter.txt'); 5isAbsolute.win32('\\\\unc\\share'); 6isAbsolute.win32('\\\\unc\\share\\foo'); 7isAbsolute.win32('\\\\unc\\share\\foo\\'); 8isAbsolute.win32('\\\\unc\\share\\foo\\bar'); 9isAbsolute.win32('\\\\unc\\share\\foo\\bar\\'); 10isAbsolute.win32('\\\\unc\\share\\foo\\bar\\baz'); 11//=> true 12 13isAbsolute.win32('a:foo/a/b/c/d'); 14isAbsolute.win32(':\\'); 15isAbsolute.win32('foo\\bar\\baz'); 16isAbsolute.win32('foo\\bar\\baz\\'); 17//=> false
About
Related projects
- is-dotfile: Return true if a file path is (or has) a dotfile. Returns false if the… more | homepage
- is-glob: Returns
true
if the given string looks like a glob pattern or an extglob pattern… more | homepage - is-relative: Returns
true
if the path appears to be relative. | homepage - is-unc-path: Returns true if a filepath is a windows UNC file path. | homepage
- is-valid-glob: Return true if a value is a valid glob pattern or patterns. | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Contributors
Commits | Contributor |
---|---|
35 | jonschlinkert |
1 | es128 |
1 | shinnn |
1 | Sobak |
Building docs
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
1$ npm install -g verbose/verb#dev verb-generate-readme && verb
Running tests
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
1$ npm install && npm test
Author
Jon Schlinkert
License
Copyright © 2017, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on July 13, 2017.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 existing vulnerabilities detected
Reason
Found 1/29 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
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 2 are checked with a SAST tool
Score
3
/10
Last Scanned on 2025-01-20
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