fs mkdir create if not exist code example
Example: node js create folder
var fs = require('fs');
const dir = './database/temp';
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir, {
recursive: true
});
}
var fs = require('fs');
const dir = './database/temp';
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir, {
recursive: true
});
}