node fs lstat 如何区别文件和文件夹

通过lstat 得到 文件的描述对象 stat。

stat.isFile()

stat.isDirectory()

原文地址:https://www.cnblogs.com/strangerqt/p/6142497.html