Introduction to Node.js

Granit Haxhaj
3 min readSep 25, 2020

Node.js is a runtime environment that allows you to execute Javascript code outside of a browser. It is open sourced and cross platformed. This means that you are allowed to use Node.js on different computer operating systems. You are also allowed to study and change the software as you wish. Node Js was first introduced in 2009 by Ryan Dahl. At the time, the Apache HTTP Server was what most used to run their web servers. Dahl saw limitations with it, one being that it can only hold up to 10,000 simultaneous connections. He combined a Javascript engine, an event looper, and an API to create Node.js. Node.js is currently at version 13.9.0 and commonly used by developers everywhere.

That’s cool… but what does it do?

Node.js is typically used for building backend servers, such as web and mobile application APIs. These are back-end servers that talk to the application and flood it with data. Node.js is great for building APIs that are data intensive and APIs that are being used for real-time applications. Huge companies like Pay-Pay, Uber, and Netflix run their back-end servers with Node.js.

However, the biggest key about Node.js is that it allows you to use Javascript to code back-end servers. This means that developers who know Javascript are able to create fully functional web applications that persist in a back-end. What does this mean for you? You can now build the frameworks of a fully functional application using one coding language. Node.js also has the largest amount of library resources available. You have the information to do incredibly complicated things on your back-end server.

That’s also cool… But how do I get started?

You can download Node.Js here. Once you have it fully installed and operating on your computer, create a file named “app.js.” Run this line of code and type in “node app.js” within your terminal :

This creates a server for you to be able to run and test your application. Every developer should know about our good old friend, “http:/localhost:3000.” This is what creates that server and allows you to use it.

The rest is up to you! You can create a fully functional application with Node.js coding in Javascript. Here are some example snippets of code for common functions of web applications.

Adding a New User to Your System

Validating User Authentication

Creating A Node JS App

Additional Sources Used:

https://www.youtube.com/watch?v=uVwtVBpw7RQ

https://www.youtube.com/watch?v=TlB_eWDSMt4

https://www.w3schools.com/nodejs/

--

--