How do i check the existence of a file?
In the documentation for the module fs there\'s a description of the method fs.exists(path, cal
fs
fs.statSync(path, function(err, stat){ if(err == null) { console.log('File exists'); //code when all ok }else if (err.code == "ENOENT") { //file doesn't exist console.log('not file'); } else { console.log('Some other error: ', err.code); } });