Node is a big framework with many built-in modules and concepts which you need to learn, but they require much longer time and bigger effort. so step by step we’ll understand modules in the node.
Why Node Popular?
NPM is the world’s largest collection of free and reusable code. You can make a feature-rich Node application by using code that’s freely available on NPM. Npm is a reliable package manager, which comes with a CLI that we’re going to explore and that CLI makes it easy to install third-party packages and, in general, share your own code and reuse your own code.
Node comes with first-class support and easy APIs for many asynchronous operations, like reading and writing files, consuming data over the network, and even compressing and encrypting data. You can do all the operations in Node asynchronously without blocking the main execution thread.
In the Node we build simple, small, single process, nodes, building blocks, that can organize with good networking protocols. to have them communicate with each other and scale up to build large distributed programs.
How to Install Node?
Follow the step by step instructions on how to install Node.
To install Node on Windows, you can simply download the installer from the nodejs.org website and run it locally.
There’s another option that works on both Mac and Linux, and that is nvm, Node version manager. I like this option because it allows you to run multiple versions of Node and switch between them using a simple command. If you find yourself in a situation where you need to work on a project that uses different versions of Node, nvm will help you here.
Linux, Mac and other platforms
— $ node
> 1 + 3 4 > 1 + ( 2 * 3 ) - 4 3
If this line was executed successfully without any errors, as it did for me here, you have a good version of Node. If you get an error here, you should upgrade your Node.
You can also test if your Nodejs has the new promises APIs using these two calls in here. Util. promising should return a function like this and require fs. promises should return an object of the full fs API, like this.