Update index.js
Update index.js

 It catches also other exceptions. So in case there are rights issues e.g. chmod ugo-rwx filename or in Windows  Right Click -> Properties -> Security -> Advanced -> Permission entries: empty list .. function returns exception as it should. The file exists but we don't have rights to access it. It would be wrong to ignore this kinds of exceptions.

I commented also on stackoverflow: http://stackoverflow.com/questions/4482686/check-synchronously-if-file-directory-exists-in-node-js/35016418#35016418
scottcorgan/file-exists