Closed Dan503 closed 8 years ago
right, that's an anti-pattern for async usage at this level. Implementors can do what you did in your example, or you could use deleteEmpty.sync
.
If all you want to do is apply a quick asynchronous folder clean then this syntax should be allowed
deleteEmpty('folder/');
The callback parameter just needs this applied to it
callback = typeof callback === 'undefined' ? callback : function(){};
I don't see why you want to force your users to use this syntax:
deleteEmpty('folder/',function(){});
It's unintuitive having to write that.
This doesn't work
But this does: