javascript - Node.js reload external file every n-minutes -


i've got question regarding loading external files in node.

basically i'm loading external json file contains configuration, , file modified external process every 10 minutes. how can reload file every 10 minutes, without restarting node?

i've tried solution:

delete require.cache['/home/conf/myfile.json'] 

but people have advised against it. can me?

at end changed code , use fs.readfile load json file, instead of using require.

i used node-watch check changes in file , reload it.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -