create new file if not exists in nodejs code example
Example: nodejs fs create file if not exists
fs.exists(filename, function(exists) {
if(exists) {
// Create a file
}
else {
console.log("Deny overwrite existing", filename);
}
});
fs.exists(filename, function(exists) {
if(exists) {
// Create a file
}
else {
console.log("Deny overwrite existing", filename);
}
});