showing results for - "javascript folder exists"
Tom
25 Jan 2020
1const fs = require('fs');
2
3// directory to check if exists
4const dir = './uploads';
5
6// check if directory exists
7fs.access(dir, (err) => {
8    console.log(`Directory ${err ? 'does not exist' : 'exists'}`);
9});
10