In this blog post, I am going to discuss on What is Node.js, Why is it used and a quick demonstration on how Node.js is filling the developer needs.
What is Node.js
Netflix, Uber and Walmart are using Node.js in production.
Node.js is not a programming language. It provides various tools that node developers need like libraries for setting up web servers, integrating with the file systems so you can read and write from disk.
Why is Node.js
Useful for developers anywhere on the stack. So being front-end developers we might need to use a little node here and there to compile our apps or maybe serve up a website we are working with.
Obivously, backend engineers are using node.js extensively to build out their web app backends, API’s and command line applications.
Node.js uses an event driven, non-blocking I/O(Input/Output) model that makes it lightweight and efficient.
Node.js is a package ecosystem. NPM is the largest ecosystem of open source libraries in the world.
NPM is a tool that was actually installed on our machine when a node was installed.
From npmjs.com, we can search for plenty of pre-written packages that we can use inside of our application.
Download and Install the latest version of node from nodejs.org
Download and install Visual Studio Code Editor.
Demo on how to use Node.js Core Modules:
By executing the app.js in terminal, a new file notes.txt will get created with the string we passed as argument.
Demo on using npm Modules:
By giving the following commands in the terminal, we can install npm libraries into our project.
npm install validator
npm install chalk
Now execute the app.js file again and here is the output of it.
Finally i came to end of my blog. I will be posting few more learning’s on Node.js.
Please comment if any..