Created
December 2, 2016 18:44
-
-
Save beatak/76f9fdfac6ab04663a8315ca5c1069be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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