raszi / node-tmp

Temporary file and directory creator for node.js
MIT License
737 stars 93 forks source link

Graceful Cleanup should be the default #195

Closed silkentrance closed 5 years ago

silkentrance commented 5 years ago

make graceful cleanup the default and let user override that by calling setGracefulCleanup(false)

silkentrance commented 5 years ago

see also #194

raszi commented 5 years ago

Thank you for the work @silkentrance. I don't like this change, we should update the README file to set the expectations right, but definitely not alter the listeners.

I would like to get rid of this feature soon so changing the behavior to remove the files per default is not a great way to get there.

silkentrance commented 5 years ago

@raszi Then I think that someone will have to work on the readme and add the missing information.

silkentrance commented 4 years ago

Not to mention that the information in the readme was already in there.

However, this requires a lot more effort - checking on whether a directory, and by that tree of that, is actually empty...

silkentrance commented 4 years ago

we might get around this by just calling upon rmdirSync and capturing the resulting exception, if the specific directory was not empty. which should be the standard behaviour, I believe.