npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

is-directory-empty

1.0.0

@sindresorhus

npmHomeRepoSnykSocket
Downloads:8
$ npm install is-directory-empty
DailyWeeklyMonthlyYearly

is-directory-empty

Check if a directory is empty

It uses the fastest way to check.

Install

npm install is-directory-empty

Usage

import {isDirectoryEmpty} from 'is-directory-empty';

console.log(await isDirectoryEmpty('./some-directory'));
//=> true

API

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.