This is the node.js in action article series. We have already covered many topics in node.js in this series. You can read them here.
- Node.js in Action : implement simple http server using node.js
- Node.js in Action: Hit counter example in node.js
- Node.js in Action: Understand Modules in Node.js
- Node.js in Action: understand "os" module in node.js
- Node.js in Action: Understand Request Module
- Node.js in Action : Create Simple Text File in Node.js Using "fs" Module
In this article we will work with another interesting module, the color module. The color module uses the popular color.js. Since the color module is not a built-in module of node.js, we need to install it using the node package manager.
Before that I will request that you check whether node is set up and running in your application. To install the colors module in an application, just navigate to the proper directory and fire the following command.
npm install colors
Once the command has executed successfully, you will find the following screen. In my case it's showing that the colors module was successfully installed in the application and is ready for use.

The beauty of the colors module is that we can beautify the output with various colors. Here is the link to the colors module in NPM.
Colour
Let's implement a few small examples to understand how the colors module works with node.js. Have a look at the following example.
var http = require('http');
var colors = require('colors');
var server = http.createServer(function (req,res) {
console.log('This String Will Display RED'.red);
});
server.listen(9090);



Join the conversation! Your thoughts help the community grow.