thombruce / tnt

Thom's Nuxt Template
https://tnt.thombruce.com/
MIT License
1 stars 0 forks source link

[Refactor]: (Electron) Use fsPromises API instead of wrapping fs in custom promises #95

Closed thombruce closed 3 months ago

thombruce commented 3 months ago

As the title says, we're currently using plain old fs but all of our fs calls are being wrapped in promises. This ought to be equivalent to just using the fsPromises 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.

thombruce commented 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.