Here is how I understand the concept of node.js :
Ok ! Lets go with WTF is node.js ?
There is no node.js by default in your machine. You need to install it separately. For that you can download form nodejs.org . After you install it in your machine you can run node.js in terminal .
tying "node" and pressing enter start the node platform in your terminal. node -| var a = 1; undefined a -| 1
Its like doing javascirpt in browser console. The different in terminal is there is no window object but there is the global object. i.e
global.a -| 1
What are Npm modules ?
NPM means Node Package Manager. These are libraries worked by the wonderful network which will take care of a large portion of your non specific issues. npm (Node package manager) has bundles you can use in your applications to make your improvement quicker and proficient.
Based on node.js, people build frameworks. you could really put all your code into one big index.js record, regardless of how vast or complex your application is. The Node.js translator couldn’t care less. However, as far as code association, you would wind up with a difficult to comprehend and difficult to troubleshoot mess rapidly. So as an individual, you should think about how to structure your code. This is the place modules come in.
Take example of react :
sudo npm install -g create-react-app
Doing this, it install the react module in the folder with its dependencies. It takes care of every configuration. .Now that we have create-react-app installed, create our first app according to the guidelines of react.js.