Getting Started with NodeJS

Anjula Jayasinghe
3 min readMay 5, 2022

NodeJS is an open-source, cross-platform JavaScript runtime environment. This runtime environment was developed by Ryan Dalh with the aim of developing real-time web applications with push capabilities. With the help of V8 engine (Chrome’s JavaScript engine) NodeJS can execute JavaScript code outside a web browser. But the most important thing with NodeJS is the ability to handle concurrent requests with its non-blocking I/O. Because of that NodeJS is now widely used for developing server-side and networking applications.

Let’s take a look at some of the key characteristics of NodeJS

  • NodeJS has an event-driven architecture which is capable of doing I/O operations asynchronously. This makes NodeJS lightweight and efficient.
  • NodeJS does not create a thread for each connection. It handles all of them in a single thread. Its’ non-blocking I/O helps it to achieve that.
  • NodeJS uses Chrome’s V8 engine. The V8 engine compiles JavaScript code into machine code directly.
  • NodeJS represents a “JavaScript everywhere” paradigm. That means it allows developers to use a single programming language from one end of the applications to the other end.
  • ‘npm’ package manager gives access to large number of open source libraries
  • Since NodeJS is open-source, developers can edit the source code for their liking.

When to use NodeJS?

NodeJS is ideal for developing,

  • I/O bound applications
  • Fast scalable network applications
  • Real-time applications
  • JSON APIs based applications
  • Single page applications

LinkedIn, Netflix, Uber, Trello, PayPal, NASA, eBay and Medium are some of the popular companies that use NodeJS as their JavaScript run-time environment.

Now let’s take a quick look at how you can set up NodeJS environment on your PC.

Step 1 — Download the installer from NodeJS website

Step 2 — Run the installer

Step 3 — After finishing the installation, restart your machine.

Now you can check your node version by entering the following command in command prompt

And also you can check the npm version with the following command

Let’s create test.js

You can run test.js with node test.js command

That’s it! Now you are ready to start your journey with NodeJS ;)

--

--

Anjula Jayasinghe

Associate SE at Tracified-99x | SE Undergraduate at SLIIT