Did you know how useful Node.js is? Check out more here
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9127047-7325-480c-95f1-0ebbda563b89_720x480.webp)
There is a lot to keep track of as a developer. Every time you turn around there is a new technology to learn. We can’t allow that to be an excuse not to know.
I have run into Node.js quite a few times over the years. On various projects, it would come up. The time has come for me to learn a little more.
What is Node.js?
Node.js is “an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications.” That is how the folks at Node.js define it.
The first word that jumps out at me is asynchronous(not existing or happening simultaneously). I remember how AJAX programming changed things.
This was a big game-changer from the old paradigm. We had to submit forms to the server and create a new page. We could use client-server principles on the web.
Here is some more information from Moshe.
History
Ryan Dahl originally wrote Node.js back in 2009. He was frustrated at the concurrent connections that Apache had to handle. These numerous connections led to issues that inspired Ryan to start working on what would become Node.js.
The use of Node.js picked up as many browsers could improve performance with its use. Developers liked using it too. Node.js was part of many open-source libraries.
Common Uses
Node.js works best in real-time web applications that use push technology. This ushered in the stateful experience we are all accustomed to. We can dynamically update a web application immediately.
Limitations
Some of the drawbacks of Node.js are the performance issues with heavy computational tasks. There are numerous nested calls. Finally, the API can be quite unstable too.
Install Node.js
Installing Node.js is quite easy. You can go here and get the download you need. However, you should check if it is already installed. Depending on what coding you have done it may have been installed already.
As I did here type “node -v” at a command prompt to check. I currently have version 16.13.1 installed.
Example Code
A simple example of Node.js is to create a server. Of course, a very simple server at that.
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.end('Hello Node.js World!');
}).listen(8080);
Simply running “node MyFirstNode.js” at your command line will launch the server. Then open your browser to
http://localhost:8080/
and see the message.
Okay, so you have scratched the surface. What should you do next? Well, that is a great question.
Digging Deeper
The people at Node.js have numerous guides that you can review. If you are looking for more learning check out Code Academy’s free course Learn Node.js. Also Dave Gray has a Node.js Course for Beginners.
I enjoy novelty. Learning new things can get me excited. Node.js has been around for a few years. Tools like it have impacted the history of the web. We made a big transition from the server-request model to the more interactive paradigm of today.