Answers for "javascript folder exists"

1

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'}`);
});
Posted by: Guest on December-08-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language