Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Continously check if a file exists and do something if it does

I'm creating a simple project using Node.JS and fs, I'm trying to make it detect if a file is existent and do something automatically if it detects that without breaking it.

I use express to redirect the URL to what I need it to do so if it loops again and again it will break it.

Is there some sort of simple way I can check again and again if something exists and if it does stop the loop and do something?

Comments