Nodejs check file exists, if not, wait till it exist

前端 未结 7 720
一向
一向 2021-02-05 08:54

I\'m generating files automatically, and I have another script which will check if a given file is already generated, so how could I implement such a function:

f         


        
7条回答
  •  无人及你
    2021-02-05 09:20

    fs.watch() API is what you need.

    Be sure to read all the caveats mentioned there before you use it.

提交回复
热议问题