JS es directorio

const fs=require("fs");

fs.lstatSync(path_string).isDirectory();
dan1st