How can I synchronously check, using node.js, if a file or directory exists?
Chances are, if you want to know if a file exists, you plan to require it if it does.
function getFile(path){ try{ return require(path); }catch(e){ return false; } }