jprichardson / node-fs-extra

Node.js: extra methods for the fs object like copy(), remove(), mkdirs()
MIT License
9.47k stars 772 forks source link

Some options for emptyDir() (and not only) #935

Closed 1aerostorm closed 2 years ago

1aerostorm commented 2 years ago

At current moment, emptyDir() removes all files. We cannot filter out some file names or extensions. We cannot even filter out hidden files. E.g. it will remove .gitkeep file, and it makes this function useless for me.

We even cannot adjust the recursion depth...

RyanZim commented 2 years ago

For more complex use-case, you would be better off deleting the files in the directory individually.

1aerostorm commented 2 years ago

@RyanZim so that library is too limited and useless.