const fs = require('fs');
const path = './file.txt';
if (!fs.existsSync(path)) {
return ('this path dosn't exist');
} else {
return true;
}
const fs = require('fs')
const path = './file.txt'
try {
if (fs.existsSync(path)) {
//file exists
}
} catch(err) {
console.error(err)
}