Installing the Express framework and other modules
Now that we have npm
installed, let's make use of it and install some of the modules we will be using heavily throughout this book. The most important among them is the Express framework (http://www.expressjs.com/). It is a flexible web application framework for Node.js, providing a robust RESTful API for developing single or multi-page web applications. The following command will download the Express module from the npm repository and make it available for our local Node.js installation:
npm install -g express
You will find the express
module among the results of an npm ls
after a successful installation. Later in this chapter, we will learn how to write unit tests for our Node.js modules. We will need the nodeunit
module for that purpose:
npm install nodeunit -g
The -g
option will install nodeunit
globally. This means that the module will be stored at a central place on your filesystem; usually, that is either /usr/lib/node_modules
or /usr...