Simple way for check if path exists and is a file/directory.
Example of use:
var pStat = require('stattic-pstat');
//Check if file exists
if(pStat.isFile('route/to/file.ext') === true)
{
//Path exists and is a file, do something
// ...
}
//Check if directory exists
if(pStat.isDir('route/to/dir') === true)
{
//Path exists and is a directory, do something
// ...
}
:)