I can\'t seem to get any search results that explain how to do this.
All I want to do is be able to know if a given path is a file or a directory (folder).
Seriously, question exists five years and no nice facade?
function is_dir(path) { try { var stat = fs.lstatSync(path); return stat.isDirectory(); } catch (e) { // lstatSync throws an error if path doesn't exist return false; } }