File or dir
Check if a path is a file or a directory
Installation
npm install --save file-or-dir
Usage
const check = require('file-or-dir');
const path = 'my-file'
if (check(path) == 'file') {
console.log(path + ' is a file');
} else if (check(path) == 'dir') {
console.log(path + ' is a dir');
}
Working example in test.js
License
MIT