How to watch a file for changes using Node.js?
Originally Published Here ๐!
To watch for any changes to a file, you can use the watchFile() method from the fs (filesystem) module in Node.js.
// require fs (filesystem) module
const fs = require("fs");
// use fs.watchFile() method to look for cha...
melvingeorge-me.hashnode.dev2 min read