Initial commit
[yaffs-website] / node_modules / fs-exists-sync / README.md
1 # fs-exists-sync [![NPM version](https://img.shields.io/npm/v/fs-exists-sync.svg?style=flat)](https://www.npmjs.com/package/fs-exists-sync) [![NPM downloads](https://img.shields.io/npm/dm/fs-exists-sync.svg?style=flat)](https://npmjs.org/package/fs-exists-sync) [![Build Status](https://img.shields.io/travis/jonschlinkert/fs-exists-sync.svg?style=flat)](https://travis-ci.org/jonschlinkert/fs-exists-sync)
2
3 > Drop-in replacement for `fs.existsSync` with zero dependencies. Other libs I found either have crucial differences from fs.existsSync, or unnecessary dependencies. See README.md for more info.
4
5 ## Install
6 Install with [npm](https://www.npmjs.com/):
7
8 ```sh
9 $ npm install fs-exists-sync --save
10 ```
11
12 ## Usage
13
14 ```js
15 var exists = require('fs-exists-sync');
16
17 console.log(exists('.'));
18 //=> true
19 console.log(exists(process.cwd()));
20 //=> true
21 console.log(exists('README.md'));
22 //=> true
23 console.log(exists('foo.txt'));
24 //=> false
25 console.log(exists(''));
26 //=> false
27 console.log(exists());
28 //=> false
29 ```
30
31 ## Why another "exists" lib?
32
33 I just want a _simple replacement for `fs.existsSync`_. Here is what I found:
34
35 - [path-exists][]: Has dependencies to support a promises API
36 - [fs-exists][]: async only
37 - [file-exists][]: returns `false` if the path exists but is a directory.
38 - [exists][]: nothing to do with `fs`. 
39
40 ## API
41
42 ## Related projects
43
44 You might also be interested in these projects: 
45
46 * [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)
47 * [parse-filepath](https://www.npmjs.com/package/parse-filepath): Pollyfill for node.js `path.parse`, parses a filepath into an object. | [homepage](https://github.com/jonschlinkert/parse-filepath)
48 * [try-open](https://www.npmjs.com/package/try-open): Tries to open a file using fs.openSync (only necessary with sync), fails gracefully if the… [more](https://www.npmjs.com/package/try-open) | [homepage](https://github.com/jonschlinkert/try-open)  
49
50 ## Contributing
51 Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/fs-exists-sync/issues/new).
52
53 ## Building docs
54 Generate readme and API documentation with [verb][]:
55
56 ```sh
57 $ npm install verb && npm run docs
58 ```
59
60 Or, if [verb][] is installed globally:
61
62 ```sh
63 $ verb
64 ```
65
66 ## Running tests
67 Install dev dependencies:
68
69 ```sh
70 $ npm install -d && npm test
71 ```
72
73 ## Author
74 **Jon Schlinkert**
75
76 + [github/jonschlinkert](https://github.com/jonschlinkert)
77 + [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
78
79 ## License
80 Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
81 Released under the [MIT license](https://github.com/jonschlinkert/fs-exists-sync/blob/master/LICENSE).
82
83 ***
84
85 _This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on April 09, 2016._
86
87 [verb]: https://github.com/verbose/verb
88 [path-exists]: https://github.com/sindresorhus/path-exists
89 [fs-exists]: https://github.com/meryn/fs-exists
90 [file-exists]: https://github.com/scottcorgan/file-exists
91 [exists]: https://github.com/tjmehta/exists
92