-
Notifications
You must be signed in to change notification settings - Fork 774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add isEmpty and isEmptySync methods so that I don't need to use 'extfs' as well as 'fs-extra' #420
Comments
@kruncher can you elaborate on the use case? |
@jprichardson To determine whether or not a directory is empty. To be more specific, in my current use case, I want to run some logic if the given directory is empty but I want to stay clear and present the end-user with an error message if it contains files and/or sub-directories. The implementation provided by |
Can you elaborate more here? What logic do you want to run if it's empty? Why would you not just present an error message if the directory exists? I'm trying to figure out the strong use case of not just checking if the directory exists? i.e. why is that not good enough? |
Because the empty directory is created by an entirely different process. |
you could use the native
no need for a whole library to avoid 1 line of code. hope this helps you. |
@jprichardson What's the decision here? |
Overall, this feels like a tiny edge-case not worth supporting. Closing at least for now. |
It would be nice to avoid the need to be dependent on 2 separate packages
fs-extra
andextfs
when doing file manipulations:It would be nice if
fs-extra
includedisEmpty
andisEmptySync
methods such that the following is possible:or:
The text was updated successfully, but these errors were encountered: