The world of Web development is segregated as Front-End and the Back-End. Server-side scripting, a technique used in web development that employs scripts on a web server producing a response customized for each user’s (client’s) request to the website. There are a number of server-side scripting languages available – ASP.NET, Java, Python, Perl, PHP, NodeJS, etc. In fact, Node is one of the most popular server side scripting languages in recent times with large scale companies implementing it.
Node.js
Node JS is an open-source, cross-platform JavaScript run-time environment for executing JavaScript code server-side. It is a JavaScript runtime built on Chrome’s V8 JavaScript engine. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js’ package ecosystem, npm, is the largest ecosystem of open source libraries in the world. Node.js was developed by Ryan Dahl in 2009.
Furthermore, it provides a rich library of various JavaScript modules which simplifies the development of web applications using Node.js to a great extent.
Node.js = Runtime Environment + JavaScript Library
Environment Required
The environment required to run Node,
- A Text Editor (Notepad++, Sublime Text, etc)
- Node.js binary files
Once the installation is complete, type the below command on the command prompt.
This command gives the current version of NodeJs installed on the machine.
Hello, World!
The first program written on all programming platform begins with the ‘Hello, World!‘, and we follow the same.
To execute the code,
Click on the browser, type http://localhost:5000/ and hit enter.
NPM – Node Package Manager
npm is the package manager for JavaScript and the world’s largest software registry.
- Online repositories for node.js packages/modules on search.nodejs.org
- Command line utility to install Node.js packages.
After the V0.6.3, the npm comes bundled in with NodeJs installable files.
To verify the version of NPM, type,
To install an NPM module, type,
Backend developer, Works on C#, SQL server lives in Manipal, Karnataka, India.