1.0.0 • Published 7 years ago
file-or-dir v1.0.0
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
1.0.0
7 years ago