Closed thombruce closed 3 months ago
Just toying with this, I got as far as replacing the config readFile
usage with the fs Promises version but...
The promise returns a string. Our promise returns the config object parsed from JSON.
It looks as though we have a lot more flexibility doing it the way we currently are. It still may be worth more of a look, but this might not actually be a desirable change.
As the title says, we're currently using plain old
fs
but all of ourfs
calls are being wrapped in promises. This ought to be equivalent to just using thefsPromises
API - if not, it should only require small changes to comply with it. Our code will be a lot more lean as a result, and a little easier to debug and maintain.