fs.exists(filename, function(exists) { if(exists) { // Create a file } else { console.log("Deny overwrite existing", filename); } });