javascript exists dir code example
Example: javascript folder exists
const fs = require('fs');
// directory to check if exists
const dir = './uploads';
// check if directory exists
fs.access(dir, (err) => {
console.log(`Directory ${err ? 'does not exist' : 'exists'}`);
});