const isDirEmpty = () => { let path = "./files_to_move"; fs.readdir(path, async function(err, files) { if (err) { throw err; } else { if (!files.length) { console.log("empty"); return true; } else { console.log("not empty"); return false; } } }); } let re = isDirEmpty(); console.log(re);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)