checkdir
Check if dir exists, if it's empty and how many files are directly inside it.
Install
$ npm install checkdir
Usage
var checkdir = require('checkdir');
checkdir('/some/test/dir').then(info => console.log(info));
checkdir('/some/test/dir', { ignoreDotFiles: true })
.then(info => console.log(info));
API
checkdir(directoryPath)
directoryPath
Required
Type: String
Path to directory.
options
ignoreDotFiles
Type: Boolean
(Default: false
)
Don't count files/folders that begin with the dot ('.') character, e.g.. '.git' or '.gitignore'.
License
MIT © DaveJ