Node.js excels at:
High availability API's, the asynchronous model reduces the amount of processor time being wasted in idle while waiting for external resources to be processed.
Pub-Sub systems like a chat server using WebSockets through Socket.io.
High availability Proxy services.
Develop desktop applications using Electron!
What Node isn't that good at:
Intensive processing on the server, if you have a task that you need to crunch, 9 times out of 10 there is a better tool around.
What you will learn#
By the end of this tutorial you will have a good grasp on the following:
How to use NPM, and understand how your Package.json file works
Understanding the basics of a Node.js application
Asynchronous programming using promises and the event loop
Building basic Node.js API using express
Using Node standard library, and the file system package
Try Catch error handling with Node
Prerequisites - What You Need To Know#
Step 0: Installing Node.js#
Node.js is available for most platforms.
If you are using brew on macOS you can install it as follows:
For Windows, Linux, macOS and other operating systems, you can download the Node binaries from here
Or you could use NodeSource to get your platform-specific binaries.
Step 1: Writing our Hello world with Node.js and understanding the basics of asynchronous programming.#
In an empty directory create a file named
app.js with a single line of code as follows