The thing I wished I knew when learning Node.js

Tom Smykowski
3 min readMay 23, 2022

If you are new to the crazy world of 2022 software development, and wonder what the heck if Node.js, this article is for you! Especially if you have prior experience with things like PHP, Java, Apache etc. Because I will write from this perspective.

So what is Node.js ? Is it a server? Why it is needed to install packages? Why people use it at the same time to serve apps? Let me explain. Because it is confusing, and I wished also someone explained it to me before I got into Node.js.

The simplest definition of Node.js is that:

Node.js is a runtime environment for JavaScript

Use case 1: Node.js as a part of a server

When you call a java command on a Java file, your file is executed by Java runtime environment. When you open a PHP file in the browser, an Apache server asks PHP runtime environment to execute PHP script. Similarly, Node.js is used to execute JavaScript files.

Similarly to other runtime environments, Node.js comes with prebuilt commands you can use in your JavaScript file to access local files, databases, processes, etc.

So you can have a server with Node.js and the server will be configured to execute JavaScript files when a user visits the page.

--

--

Tom Smykowski

Software Engineer & Tech Editor. Top 2% on StackOverflow, 3mil views on Quora. Won Shattered Pixel Dungeon.