Starting My Node.Js Journey

An Introduction to Node.Js

Karina Guerra
3 min readMay 29, 2021
Node.JS Logo

As I solidify my knowledge on JavaScript, I wanted to branch out to learn more frameworks and programming languages. And Node.Js is the first one I will tackle! I am sure there will be plenty more blogs as I dive deeper into Node.JS so stay tune that. Now Let’s begin!

What is Node.Js ?

Introduced by Ryan Dhal in 2009, Node.Js, or Node, is a free open-source, server-side JavaScript runtime environment. In other words, it is a lightweight web framework that allows us to execute code outside of a web browser. Normally, we use JavaScript to operate on the client side to manipulate the DOM, basically the user interface. But we can execute all types of sever-side applications directly in JavaScript!

It based on on Google’s V8 JavaScript engine (the core of Google Chrome). This JavaScript engine powers many modern browsers like Google Chrome (of course), and Microsoft Edge. It runs on many platforms like Windows, Linux, Unix, Mac OSX and more.

We can build:

  • SPAs (Single Page Applications)
  • RTAs (Real Time Applications)
  • REST / GraphQL APIs
  • Streaming Applications
  • SSRs (Server Side Rendered Applications)
  • Websocket Services & more!

Why learn Node.Js?

Node.Js is extremely popular among developers and companies (like Uber, Netflix, Trello, LinkedIn, Yahoo, PayPal etc.). So why use it?

Node.Js is Asynchronous

Node utilizes asynchronous thread to handle of its request, which allows it to run in a single process. This is because of its use of non-blocking I/O model. (I will talk about Node fundamental concepts like this in a future blog!). A Node server will never wait for an API to return data, it will simply move to the next request after calling that first request. This paradigm allows Node to handle thousands of concurrent request without waiting for responses. Not only does this make Node.Js fast, responsive, and scalable but it is also memory efficient!

To fully understand asychronous programming, dive into these JavaScript Concepts:

  • Callbacks
  • Promises
  • Async & Await
  • Closures

Node.Js is just JavaScript

Before Node.Js, backend servers and applications were written in different languages. Meaning if you are full stack developer, you would need to learn multiple languages to handle both the frontend and backend. With Node, developers that write JavaScript in the frontend can also write server-side code without learning a whole new language! It is just pure JavaScript which can make our lives a whole lot easier.

All you need to know are the core concepts in JavaScript like:

  • Arrays
  • Types
  • Expressions & Functions (Including Arrow Functions)
  • Variables
  • this
  • Loops
  • Scope

Setting Up Node.Js

Officially, you can find packages and all download options at the website (but I will be going over installing Node on macOS and Windows).

macOS

bash

curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p')}.pkg" > "$HOME/Downloads/node-latest.pkg" && sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"

Homebrew

brew install node

Windows

Direct Download

You can download it directly through the Windows Installer from the nodejs.org web site.

Chocolately

cinst nodejs
# or for full install with npm
cinst nodejs.install

Conclusion

For the start of my Node journey, I wanted to make a formal introduction. I wanted to explain what Node.Js is and the advantages to it. See you in the next one and happy coding!

References

--

--

Karina Guerra
Karina Guerra

Written by Karina Guerra

Salvadoreña exploring the world of coding. Petting animals and building things that help people and the environment are my two biggest passions :) Based in NYC.

No responses yet