existsSync's implementation is like this (v0.10.25):
function (path) {
try {
nullCheck(path);
binding.stat(pathModule._makeLong(path));
return true;
} catch (e) {
return false;
}
}
so if you write program like if(fs.existsSync(thepath)){}, it is better to change it to if(fs.statSync(thepath)){}.