Getting Started with NodeJS
Let’s take a look at some of the key characteristics of NodeJS
- NodeJS has an event-driven architecture which is capable of doing I/O operations asynchronously. This makes NodeJS lightweight and efficient.
- NodeJS does not create a thread for each connection. It handles all of them in a single thread. Its’ non-blocking I/O helps it to achieve that.
- ‘npm’ package manager gives access to large number of open source libraries
- Since NodeJS is open-source, developers can edit the source code for their liking.
When to use NodeJS?
NodeJS is ideal for developing,
- I/O bound applications
- Fast scalable network applications
- Real-time applications
- JSON APIs based applications
- Single page applications
Now let’s take a quick look at how you can set up NodeJS environment on your PC.
Step 1 — Download the installer from NodeJS website
Step 2 — Run the installer
Step 3 — After finishing the installation, restart your machine.
Now you can check your node version by entering the following command in command prompt
And also you can check the npm version with the following command
Let’s create test.js
You can run test.js with node test.js command
That’s it! Now you are ready to start your journey with NodeJS ;)