Node.JS: Introduction to Back-end with JavaScript

Node.JS: Introduction to Back-end with JavaScript


Node JS


Originally, JavaScript was build mainly for running on web browsers, later on an engineer named Ryan Dhal embedded the Chrome V8 Engine, the Chrome JavaScript Interpreter, into a C++ program and called it Node.JS, which became popular in a very short time.


In this article, we will discuss Node Package Manager and Node JS - which requires an in-depth understanding of JavaScript. Please refer to our JavaScript Guide Here to learn more about JavaScript.


What is Node JS?

Node JS is a JavaScript Runtime Environment that is used to run JavaScript outside the web browser. It was developed for using JavaScript to do other tasks that can't be done via browser such as managing file system as example. Node JS was developed in 2009 and it went popular making it's community NPM Community the largest Developers community. Initially, Node JS runs only on MAC OSX and Linux, then Microsoft and Joyent implement a version that runs natively on windows.


Features of Node JS


Large Community

NPM Community is the largest developers ecosystem which Open Source with many free and open source packages and frameworks, all you need is to install Node JS on your computer and enjoy.


JavaScript Coding

JavaScript code is used completely in development with Node JS, it requires and it requires a very in-depth knowledge of JavaScript such as loops, conditional statement, functions, arrays, promises etc. 


Scalable 

Node JS projects are highly scable as different parts of the application runs on independently, which it's lead companies such as Netflix, Twitter and Uber to build their microservices with Node JS.


Event Handling

Events are handled by firing a call back function whenever the event is triggered, example is listening to a get request and retrieve the home page to the user. Try and Catch blocks are mostly embedded in the call back functions to grab and throw errors to the developer or user in the client side.


Asynchrous Coding

Asynchrous programming is supported in JavaScript, hence in Node JS. Asynchrous code are non blocking codes, which means they work without blocking other parts of the code from running. Asynchrous code are mostly used to make request such as fecthing data or connecting to a database. Example include fetch function request which is widely used to fetch data from api or to make request from the front end.


Cross Platform Compatibility

Node JS is cross platform compatible, that is, it is independently of the platform, hence support every OS such as Windows, Unix/Linux or Mac OSX.


Chrome V8 Engine

One cool feature is it developed with Google Chrome V8 Engine, which is very fast in Interpreting JavaScript code.


Uses of Node JS

Server Side

Node JS is widely used in Servers to build functional Web Applications with the help of View Engines like "EJS" - a view engine that allows embedding JavaScript code with HTML together, which is widely used in building web applications.


Building REST APIs

The game of building web applications have changed in the recent years, from traditional to modern ways, Respresentational State Transfer APIs, porpularly known as REST APIs are widely build to interact with a front end or mobile application. Express - a Node JS package, is widely used in the development of REST APIs.


Building Games and Chat Apps

Browser based games are mostly developed with Node JS and Chats Apps with mostly React on the front end, Mongo DB as Database and Express Node JS, these kind of development is known as MERN Stack and it is popular used for development of applications with REST APIs.



Thanks for reading, make sure to share our articles with your friends, and check other articles you may find interesting ones, thank you.

Post a Comment

Previous Post Next Post