Getting Started with Node.js
Harnessing JavaScript for Server-Side Development: An Introduction to Node.js. What is Node.js? Why choose Node.js?

Fullstack JavaScript developer, writing to better understand.
What is Node.js
While JavaScript is used for adding interactivity to web pages, Node.js is for providing the website logic.
Node.js is a runtime environment for JavaScript, it uses Chrome's v8 engine to run JavaScript outside the browser. Thereby allowing developers to create servers, command lines, and web applications using JavaScript.
Node.js is cross-platform and would run on any operating system.
Why use Node.js
Most of the world's developers at one point have dabbled into web development even if it's not their specific field, so I can safely say they have encountered JavaScript. And if you're coming from the front end, of course, you know JavaScript even if it's a bit.
For frontend developers, you don't have to learn a different language for the backend side. Node.js has a robust community of developers and you'd surely feel at home, with increased speed because you are familiar with JS. If you are scared, don’t be, Node.js is here to stay. 🥂
Unlike some backend languages, I/O operations in Node.js are asynchronous. Although Node.js runs on a single thread meaning operations can happen one at a time, it does it concurrently. How though? Node.js is event driven, it keeps track of a pending event (e.g. reading a file) and then executes the next task. You don't have to finish coding before listening to a podcast right? 😏
Node.js vs Browser
Hehe! Node.js runs on the server, so browser APIs won't work. 🫣
You don't have access to the DOM in Node.js, instead, you have the superpower to access file systems and manipulate them.
As exciting as new features of JavaScript are, you'd have to be cautious when implementing them on the browser. This is because some users might be using an outdated browser. 😔
Be glad! When using Node.js you don't have to limit yourself, you specify the version of Node you want to run. 💪
Running Node.js Code
You need Node.js installed on your system. Click here. Select your operating system and install using fnm.
Once that is done let's say hello world to the console. Create a new file hello.js, and write the following code.
console.log("hello world");
To run the code open your terminal in the same directory and type:
node hello
That's it! You are a genius!

It is important to familiarize yourself with JavaScript before proceeding to Node.js. See the prerequisites here.
Please like, comment, share, and stay tuned with this series because we can do more than just a hello world. 🚀



