Skip to content

Instantly share code, notes, and snippets.

@beatak
Created December 2, 2016 18:44
Show Gist options
  • Save beatak/76f9fdfac6ab04663a8315ca5c1069be to your computer and use it in GitHub Desktop.
Save beatak/76f9fdfac6ab04663a8315ca5c1069be to your computer and use it in GitHub Desktop.
var existsSyncWrap = function (mypath) {
if (typeof fs.existsSync === 'function') {
return fs.existsSync(mypath);
}
else {
try {
fs.accessSync(mypath, fs.constants.F_OK);
}
catch (er) {
return false;
}
return true;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment