You can use this:
if(!fs.existsSync("directory")){
fs.mkdirSync("directory", 0766, function(err){
if(err){
console.log(err);
// echo the result back
response.send("ERROR! Can't make the directory! \n");
}
});
}