JS - каталог

const fs=require("fs");

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