PastorGL/Gopher.js — pull request #1 by coderaiser (2014-10-02 06:44:52+00:00)
Title: Removed fs.exists

Change call to `fs.exists` to check in `fs.stat` which would be called anyway and will crash application with check
```js
stats.isDirectory()
```
when there would be no `stats` just `error`.

```
fs.exists() is an anachronism and exists only for historical reasons. There should almost never be a reason to use it in your own code.

In particular, checking if a file exists before opening it is an anti-pattern
that leaves you vulnerable to race conditions: another process may remove the file between the calls to fs.exists() and fs.open().
Just open the file and handle the error when it's not there.
```
[fs.exists in documentation](http://nodejs.org/api/fs.html#fs_fs_exists_path_callback)