Run the following command to create a package.json file for Node.js: $ npm init -y For starters, create a folder and navigate into that folder from the terminal. To explore Node’s different file watching options, let’s first set up a project.
![hs filewatcher hs filewatcher](https://miro.medium.com/max/1400/1*zkYQ5c4ntMFgJLNnt15aag.png)
#Hs filewatcher how to#
These are both excellent packages that leverage Node’s built-in file watching functionality.įor those that want to learn how to use Node’s built-in file watching capabilities and get a little closer to the metal, keep reading! First steps
![hs filewatcher hs filewatcher](https://i.pinimg.com/474x/a0/07/cf/a007cfe23e6051af8ad5c5c9d3d9d5a2.jpg)
If you’d rather install an npm package and move on, I’d recommend either chokidar or node-watch. Truth to be told, file watching can be accomplished without taking a dependency on an external package.
![hs filewatcher hs filewatcher](https://i.stack.imgur.com/hvS4z.png)
In a previous article on counting unique items in a JavaScript array, I introduced you to the system I am creating that enables our family to log when the fish ? in our aquarium have been fed.