Support promises API in patchFs
- Fix #202
@streamich Would you review this PR?
@aleung sorry for the delay - is there a reason why you've used Object.defineProperty instead of just assigning like we do with other methods?
It was a long time since I wrote the code. I can't exactly remember the reason.
I think I don't want promises to be a normal property of the object:
By default, properties added using
Object.defineProperty()are not writable, not enumerable, and not configurable.
More explanation is in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description
Hey there! Is there a reason this is not merged by now? :) I'm looking forward to use the library, however, this is a dealbreaker as I need to patch promise calls to FS.