Check folder/file exist before read and write to the file. Nodejs

But is there a way I can create my own promise rather than using “fs.promises” like my original examples? cause most of my codes are wrote that way and I would like to keep it consistent.