Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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'}`);
});
Source by attacomsian.com #
 
PREVIOUS NEXT
Tagged: #javascript #folder #exists
ADD COMMENT
Topic
Name
1+9 =