Last active
April 20, 2017 05:20
-
-
Save roatnek/d45e82642bc12cb74dc2e4c34571cf05 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
// Node.js | |
var fs = require('fs'); | |
function func() { | |
try { | |
fs.statSync('./foo/'); | |
// operate files in the directory foo | |
} catch(error) { | |
fs.mkdirSync('./foo/'); | |
func(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment