Getting the stats of a file is quick and easy in node.js with just the core file system modules fs.stat method. A stat object contains useful information about a file such as when it was last modified, and the data size of it. A stat object also contains methods that can be used to find if the current file is in fact a file, or a directory.
For a basic example of fs.stat I was able to get the stats of a readme file in a demo folder.
When getting a stat object with fs.stat, there are many useful stats on the file, but there are also useful methods like stat.isFile that can be used to find out of an item in a dir is a file, or a directory.