In this section, we implement the server application. This application should be able to monitor files and communicate with multiple clients at the same time. These are the perfect requirements to use an event-driven, nonblocking I/O application platform such as Node.js. The fact that we can also code the server application in JavaScript is another huge advantage. Additionally, the built-in package manager npm provides a variety of useful and easy to use packages.
First, we need to install Node.js on our development machine. We can download and install the latest binaries from http://nodejs.org/. Node.js automatically installs its npm
package manager, which we will use to install all the required packages for the server application.
To create a Node.js application, we will first create a package.json
file, a file that contains all metainformation about the application (such as name, version number, and dependencies):
{ ...