Beginners guide to understanding NodeJS

Emmanuel Fordjour Kumah - Jan 4 '23 - - Dev Community

Traditionally, JavaScript ran in a web browser and added interactivity to websites. Due to this, JavaScript could only be used as a client-side language. To write code on a web server, developers needed to learn expected server-side languages like PHP, Python, and Perl. Ruby, Java, etc.

The introduction of NodeJS enabled developers to use JavaScript on the server.
As NodeJS has a v8 compiler, we can run JavaScript on the server by compiling it into machine code.

The result is that you can now run code both on the server and on the client using one programming language, JavaScript.

What can NodeJS Do?

NodeJS adds more features to JavaScript and enables you to perform tasks that all server-side languages can do. For instance:

  • Create, open, read, write, delete, and close files on the server
  • Collect form data
  • Add, delete, and modify data in your database
  • Generate dynamic page content etc. These remarkable features enable us to use NodeJs as a backend for any web application.

Role of NodeJS

Whenever a user requests a resource through a web browser, the request will be sent to a web server. As soon as a request is received, NodeJS runs some JavaScript on the server and initiates a response process.

The process could be communicating with a database for specified data, opening a file on the server, reading, and returning its content to the client.

Why use NodeJS

  • Eliminate learning another programming language for the server
  • Rapid development: short learning curve when moving from frontend to full-stack development
  • Massive community support to provide help when needed
  • Tons of tools and packages, the Node Package Manager (NPM) allows you to download and use code packages provided by other developers in your own project.

Companies using NodeJS

  • Paypal uses NodeJS to build the consumer-facing side of its web applications.
  • LinkedIn uses Node.js to empower the server side of its mobile app.
  • Mozilla uses Node.js as a primary language in many of their web projects. One of them is the Mozilla Persona, a cross-platform sign-in technology.
  • Uber has built its massive matching system on Node.js.

Summary

In this article, we learned about NodeJS and why it is essential to use NodeJs in developing backend application.

If you have found insight in this article, kindly share, like, comment. I would love to read from you

This article is the day 4 post on the 30-day challenge I am undertaking to learn backend development.

Please feel free, to drop some insights, comment, or share the post to your networks

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .