1const fs = require("fs")
2
3fs.access("./directory-name", function(error) {
4 if (error) {
5 console.log("Directory does not exist.")
6 } else {
7 console.log("Directory exists.")
8 }
9})
1var fs = require('fs');
2if (!fs.existsSync(newDest)) fs.mkdirSync(newDest,'0777', true);
3