file-or-dir
v1.0.0
Published
Check if path is a file or a directory
Downloads
2
Readme
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