Created
April 19, 2016 14:36
-
-
Save yesvods/f4374f3652011ef7d73d9e4d779d22f3 to your computer and use it in GitHub Desktop.
check if directory exist, if not, create one.
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
function checkDirectorySync(directory) { | |
try { | |
fs.statSync(directory); | |
} catch(e) { | |
fs.mkdirSync(directory); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment