UNPKG

2.4 kBMarkdownView Raw
1# is-directory [![NPM version](https://img.shields.io/npm/v/is-directory.svg?style=flat)](https://www.npmjs.com/package/is-directory) [![NPM downloads](https://img.shields.io/npm/dm/is-directory.svg?style=flat)](https://npmjs.org/package/is-directory) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-directory.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-directory)
2
3Returns true if a filepath exists on the file system and it's directory.
4
5## Install
6
7Install with [npm](https://www.npmjs.com/):
8
9```sh
10$ npm install is-directory --save
11```
12
13## Usage
14
15```js
16var isDirectory = require('is-directory');
17
18isDirectory('node_modules', function(err, dir) {
19 if (err) throw err;
20 console.log(dir);
21 //=> true
22});
23
24isDirectory.sync('README.md');
25//=> false
26```
27
28## Related projects
29
30You might also be interested in these projects:
31
32* [is-absolute](https://www.npmjs.com/package/is-absolute): Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute. | [homepage](https://github.com/jonschlinkert/is-absolute)
33* [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://www.npmjs.com/package/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob)
34* [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)
35
36## Contributing
37
38Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-directory/issues/new).
39
40## Building docs
41
42Generate readme and API documentation with [verb](https://github.com/verbose/verb):
43
44```sh
45$ npm install verb && npm run docs
46```
47
48Or, if [verb](https://github.com/verbose/verb) is installed globally:
49
50```sh
51$ verb
52```
53
54## Running tests
55
56Install dev dependencies:
57
58```sh
59$ npm install -d && npm test
60```
61
62## Author
63
64**Jon Schlinkert**
65
66* [github/jonschlinkert](https://github.com/jonschlinkert)
67* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
68
69## License
70
71Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
72Released under the [MIT license](https://github.com/jonschlinkert/is-directory/blob/master/LICENSE).
73
74***
75
76_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 21, 2016._
\No newline at end of file