DEV Community

abhick09
abhick09

Posted on • Edited on

WHY you should start with NODE.js

While most of the worlds internet is filled with JavaScript we surely know that JavaScript has been through everything and is a very powerful language.While most of the time it is considered to be a language which is responsible for structuring and rendering dynamic content on the UI along side HTML and CSS BUT for quite sometime now it is being used to built the server side or the database part of the web applications which is NODE.js.
It was written using C, C++, JavaScript.

NODE.js was written by Ryan Dahl and had its first release in 2009 by the NODE.js foundation and now has partnered with the community and is under a joint partnership named OpenJS foundation.

Setup your application with your machine.
https://nodejs.org/en/download/ use this link to follow the documentation choose your system for your respective OS.

Once you have configured NODE and npm on your machine use your terminal or bash to work with node and installing packages(npm).

Node package manager is a package manager in NODE and other JavaScript frameworks as Express,React and many more which helps install various JavaScript package,libraries for helping us build large scale applications where libraries have ready to use services to handle various operations required in our application which are stored in the folder named /node_modules. https://www.npmjs.com/

Now as to build large scale applications we use frameworks where as many other technologies NODE also has many frameworks to choose from some of them are.
1.ExpressJs https://expressjs.com/
2.MeterorJs https://www.meteor.com/
3.NestJs https://nestjs.com/
4.SailsJs https://sailsjs.com/

and many more these are the top 4 frameworks according to the stars they have on GITHUB.

So why use NODE?
Node is very popular and as it uses JavaScript you can master full-stack web development with both front-end and the server side using the same language.The main feature of NODE is that it is asynchronous which as a result wont let it run out of memory and makes it very fast.As node works on single thread which can handle thousands of connections very fast using an event loop where a event is triggered and then it moves on.

Still why use NODE?
It excels with REST API,Microservices,Real Time apps(chat,live updates),CRUD apps these can be built with node and will perform very fast applications like netflix,yahoo,paypal,linkedin,godaddy are some diverse examples which uses NODE to serve there clients.

So what is a basic NODE setup?
At first just type node in your terminal and do some basic arthemtic operations or try creating functions within the terminal.
Alt Text
Alt Text
Every node project is initiated with npm init which creates a package.json file.
We need to navigate to the folder where we want node application to be setup and open the terminal/bash and enter the command npm init which creates a package.json file in your folder.
Alt Text

As in the picture we have a package.json file where as we installed express it creates a dependencies section where we can know which package have been installed.

Alt Text

Now we would want to create ourfunction.js file for our specific reasons.Will further continue with express and setup a MVC pattern CRUD app with token based authentication,file upload,route guard,nesting tables in database with relationships as person with profile tables.Stay tuned.
Meanwhile you should learn about if not JSON,Arrow functions,MVC pattern,HTTP,Promises would help you learn node fast.

Hope for a feedback to improve just wanted to give out some prerequisites if you want to start server side work with JavaScript and its many options.

Top comments (0)