Initial commit
[yaffs-website] / node_modules / is-absolute / README.md
1 # is-absolute [![NPM version](https://img.shields.io/npm/v/is-absolute.svg?style=flat)](https://www.npmjs.com/package/is-absolute) [![NPM downloads](https://img.shields.io/npm/dm/is-absolute.svg?style=flat)](https://npmjs.org/package/is-absolute) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-absolute.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-absolute)
2
3 > Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute.
4
5 ## Install
6
7 Install with [npm](https://www.npmjs.com/):
8
9 ```sh
10 $ npm install --save is-absolute
11 ```
12
13 Originally based on the `isAbsolute` utility method in [express](https://github.com/visionmedia/express).
14
15 ## Usage
16
17 ```js
18 var isAbsolute = require('is-absolute');
19
20 isAbsolute('a/b/c.js');
21 //=> 'false'
22 isAbsolute('/a/b/c.js');
23 //=> 'true'
24 ```
25
26 **Explicitly test windows paths**
27
28 ```js
29 isAbsolute.posix('/foo/bar');
30 isAbsolute.posix('/user/docs/Letter.txt');
31 //=> true
32
33 isAbsolute.posix('foo/bar');
34 //=> false
35 ```
36
37 **Explicitly test windows paths**
38
39 ```js
40 var isAbsolute = require('is-absolute');
41
42 isAbsolute.win32('c:\\');
43 isAbsolute.win32('//C://user\\docs\\Letter.txt');
44 isAbsolute.win32('\\\\unc\\share');
45 isAbsolute.win32('\\\\unc\\share\\foo');
46 isAbsolute.win32('\\\\unc\\share\\foo\\');
47 isAbsolute.win32('\\\\unc\\share\\foo\\bar');
48 isAbsolute.win32('\\\\unc\\share\\foo\\bar\\');
49 isAbsolute.win32('\\\\unc\\share\\foo\\bar\\baz');
50 //=> true
51
52 isAbsolute.win32('a:foo/a/b/c/d');
53 isAbsolute.win32(':\\');
54 isAbsolute.win32('foo\\bar\\baz');
55 isAbsolute.win32('foo\\bar\\baz\\');
56 //=> false
57 ```
58
59 ## About
60
61 ### Related projects
62
63 * [is-dotfile](https://www.npmjs.com/package/is-dotfile): Return true if a file path is (or has) a dotfile. Returns false if the… [more](https://github.com/jonschlinkert/is-dotfile) | [homepage](https://github.com/jonschlinkert/is-dotfile)
64 * [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob)
65 * [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative)
66 * [is-unc-path](https://www.npmjs.com/package/is-unc-path): Returns true if a filepath is a windows UNC file path. | [homepage](https://github.com/jonschlinkert/is-unc-path)
67 * [is-valid-glob](https://www.npmjs.com/package/is-valid-glob): Return true if a value is a valid glob pattern or patterns. | [homepage](https://github.com/jonschlinkert/is-valid-glob)
68
69 ### Contributing
70
71 Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
72
73 ### Contributors
74
75 | **Commits** | **Contributor**<br/> |  
76 | --- | --- |  
77 | 31 | [jonschlinkert](https://github.com/jonschlinkert) |  
78 | 1  | [es128](https://github.com/es128) |  
79 | 1  | [shinnn](https://github.com/shinnn) |
80
81 ### Building docs
82
83 _(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_
84
85 To generate the readme and API documentation with [verb](https://github.com/verbose/verb):
86
87 ```sh
88 $ npm install -g verb verb-generate-readme && verb
89 ```
90
91 ### Running tests
92
93 Install dev dependencies:
94
95 ```sh
96 $ npm install -d && npm test
97 ```
98
99 ### Author
100
101 **Jon Schlinkert**
102
103 * [github/jonschlinkert](https://github.com/jonschlinkert)
104 * [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
105
106 ### License
107
108 Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
109 Released under the [MIT license](https://github.com/jonschlinkert/is-absolute/blob/master/LICENSE).
110
111 ***
112
113 _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 16, 2016._