Check if a directory is empty
It uses the fastest way to check.
npm install is-directory-empty
import {isDirectoryEmpty} from 'is-directory-empty';
console.log(await isDirectoryEmpty('./some-directory'));
//=> true
isDirectoryEmpty(path: string): Promise<boolean>
isDirectoryEmptySync(path: string): boolean
Returns a boolean indicating whether the directory at the given path is empty.
Throws if the path is not a directory or does not exist.