A Hello World Program in Node.js

A hello World program in Node.js

Before I Start with hello world there are few terminologies that you should know as we are gonna use it frequently in almost every exercise we are gonna use them.
Node.js uses a module that is a predefined set of function to simplify the creation of complex application as we have libraries in C language. Each module contains some set of functions that is related to the theme of the module like for file system we will use “fs”.We can create and publish our own modules as well. To use a predefined module we use “require ()” function  ,for eg
  1. var fs = require(‘fs'); 
The require function returns the reference to the specific module. In this case, a reference to the fs(file system) module is stored in the fs variable.
Npm refers to the node package manager, it  publish, manage, and Installs node programs.
Eg: npm install mysql@2.0.0-alpha2  to install MySQL
Writing your First Application.
  1. Open Notepad and Write Console.log('Hello node.js Developers!! we are gonna learn node.js right from the basics.');
  2. save the file as hello.js
  3. Open node.js command prompt
  4. type node hello.js and press Enter
I used the cd to go the move to the location of the file and we are done with the Hello World Now.