davidedantonio/create-fastify-app

Do not use *Sync calls, use promises or callbacks

mcollina opened this issue ยท 6 comments

As titled:

if (!fs.existsSync(dir)) {
.

(And in many other places)

@mcollina Removed all Sync calls...I hope this is the right way to do it!
Do you have any other suggestion? Or do you think that's okay?

Thanks again for the suggestions! ๐Ÿ™

Do you think it is right to keep the fs.js file or move all the promisified functions to their respective files?

I would remove it.

I've removed the fs file utils except for fileExists function that I moved to the utils.js file.
I need that this function return true or false value, and I don't think it's a good solution to rewrite the same function in all the files where I need it.

Good work!