Create server

The following code creates a server and assign a port.

var http = require('http');

http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('Your node server is running');

Simply run the code and open http://localhost:8282 in your browser.


We have already seen how to read stdin (input from the terminal) as follows:


A program can take input from many different sources of streaming data. Readline module provides an interface to read data from any Readable stream including process.stdin. See Following is a simple example, I picked up from Readline documentation.

Process Object

The process object is available globally meaning that it can be accessed from anywhere in the code. It allows us to fetch information regarding the current process instance; information such as environmental variables, path, stdin, and stdout.


Save this code as processdemo.js. To run:

$ node processdemo.js

This code outputs the parameters used when the process starts. It's output is as follows:

Node Package Manager

Node Package Manager (npm) comes bundled with Node. It allows you do search Node repositories for packages and modules. Anything that is searchable on is also searchable by npm. npm can be used to install Node packages on your system. It also performs version and dependency management for all Node packages installing on your system. To find out the version of npm you are using, simply type the following command

$ npm --version

To upgrade you npm,


Node is an open source runtime environment for server-side applications. It allows you to run JavaScript on the server in addition to the browser. Almost all of the new and most widely used JavaScript solutions use Node in one form or another.

Installing Node.js

Download from Install with default options. To check, type the following on the terminal

What is Caching

A cache is a temporary data store that usually contains pre-computed data. The purpose of a cache is to provide the data the next time someone asks for it without having to re-compute the data. For example, your website needs to run a complex query to fetch results of a user request. A complex query takes time to run and uses the system's resources for the query to run. Every time someone click on a link, this query needs to run. However, if you cache the results, you can simple provide results from the cache rather than having to re-query the data.

Quick Introduction to Google Cloud

Google Cloud Platform (GCP) offers many services. They can loosely be classified as:

  • compute services
  • storage services
  • big data services
  • identity and security services
  • management tools
  • developer tools
  • other services

Compute services includes virtual machines, containers, and functions.

Storage services allow storage of files, archival storage, and persistence data. Data services include NoSQL, RDBMS, Hadoop and Spark.

Quick Introduction to Cloud

Cloud refers to hosted services over the Internet. For example, Google Drive and GoogleDocs are cloud services. Google Drive allows you to save your files on their hardware. GoogleDocs is a collection of software (word processor, spreadsheet, etc.) hosted on Google's servers. The software resided on Google's hardware and uses their memory and CPU. You access it through the Internet. The are three category of cloud services: