Welcome to mirror list, hosted at ThFree Co, Russian Federation.

readme.md « path-is-absolute « node_modules - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cdf94f4309a27e4e3f1f200370977d599868b261 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute)

> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill

> Ponyfill: A polyfill that doesn't overwrite the native method


## Install

```
$ npm install --save path-is-absolute
```


## Usage

```js
var pathIsAbsolute = require('path-is-absolute');

// Linux
pathIsAbsolute('/home/foo');
//=> true

// Windows
pathIsAbsolute('C:/Users/');
//=> true

// Any OS
pathIsAbsolute.posix('/home/foo');
//=> true
```


## API

See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path).

### pathIsAbsolute(path)

### pathIsAbsolute.posix(path)

The Posix specific version.

### pathIsAbsolute.win32(path)

The Windows specific version.


## License

MIT © [Sindre Sorhus](http://sindresorhus.com)