Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
index.js | D | 12-May-2024 | 611 | 21 | 14 | |
license | D | 12-May-2024 | 1.1 KiB | 22 | 17 | |
package.json | D | 12-May-2024 | 1.7 KiB | 76 | 75 | |
readme.md | D | 12-May-2024 | 1.1 KiB | 60 | 38 |
readme.md
1# path-is-absolute [](https://travis-ci.org/sindresorhus/path-is-absolute) 2 3> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) 4 5 6## Install 7 8``` 9$ npm install --save path-is-absolute 10``` 11 12 13## Usage 14 15```js 16const pathIsAbsolute = require('path-is-absolute'); 17 18// Running on Linux 19pathIsAbsolute('/home/foo'); 20//=> true 21pathIsAbsolute('C:/Users/foo'); 22//=> false 23 24// Running on Windows 25pathIsAbsolute('C:/Users/foo'); 26//=> true 27pathIsAbsolute('/home/foo'); 28//=> false 29 30// Running on any OS 31pathIsAbsolute.posix('/home/foo'); 32//=> true 33pathIsAbsolute.posix('C:/Users/foo'); 34//=> false 35pathIsAbsolute.win32('C:/Users/foo'); 36//=> true 37pathIsAbsolute.win32('/home/foo'); 38//=> false 39``` 40 41 42## API 43 44See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). 45 46### pathIsAbsolute(path) 47 48### pathIsAbsolute.posix(path) 49 50POSIX specific version. 51 52### pathIsAbsolute.win32(path) 53 54Windows specific version. 55 56 57## License 58 59MIT © [Sindre Sorhus](https://sindresorhus.com) 60