What is the use of node.js ?

Unknown
0
You can use node.js in two ways according to node.js website.

https://nodejs.org/en/

  1. npm (node package manager)
  2. Run javascript outside the browser

npm 

Nowadays lots of js frameworks are available in market (e.g. Angular, backbone, require, react). If you want to use that framework in your application
you need to go to the respective website and download it. It is cumbersome job to download and configure it. What if I say there is one package manager 
which will take care of your this problem you just need to give install instruction. It is like one central application which will install required js framework
on your behalf.

Note: If you are from .Net Background you must be thinking why npm when I already have Nuget Package manager. Nuget is good for server side assemblies and framework, 
for client side npm is best. According to node.js site " npm, is the largest ecosystem of open source libraries in the world."

Below is the step to configure it.

Download and install node.js from its website (https://nodejs.org/en/)
Once you are done with installation, you will find node.js command window.
By default it store files in user directory.









As you can see we created package.json file first and wrote all require js framework for our application and save it in our project folder. After that we just hit command npm install and it downloaded all packages for us.

Second use of node.js is it runs outside the browser.

I have created one javascript file and trying to run it from node command prompt let's see.




Tags:

Post a Comment

0Comments

Post a Comment (0)