I've been searching for a simple way to create a function that checks for a filename within a folder to be used in an if/else scenario.
Example:
if(fs.exists('./file.txt')){ //Do Something };
else { //Do Something Else };
Nothing seems to work for me, although I'm sure it must be fairly simple and straight-forward. All of my searches are littered with deprecated methods that don't really seem to be helpful. Anything is helpful at this point. Thanks in advance!