
What is NodeJs?
Node.js is a JavaScript runtime that is based on Chrome’s V8 engine. It is a server-side JavaScript language. It is open-source and cross-platform.
It’s important to note that NodeJS is not a framework or a programming language. It’s a runtime environment for JavaScript code execution. We frequently utilize it to create back-end services such as APIs, Web Apps, and Mobile Apps.
It also comes with a large library of JavaScript modules, which greatly facilitates the building of Node.js web applications.
Features
- Asynchronous and Event-Driven: The Node.js library’s APIs are all asynchronous, i.e. non-blocking. It basically means that a Node.js-based server never waits for data from an API.
- Very Fast: It’s library is extremely quick in code execution because it is based on Google Chrome’s V8 JavaScript Engine.
- No Buffering: Data is never buffered in these apps. The data is simply output in chunks by these apps.
- It’s simple to use and used for both prototyping as well as in agile development.
- Because it uses JavaScript everywhere, it’s simple for a JavaScript programmer to use Node.js to create back-end services.
- It offers services that are both quick and scalable.
- Cleaner and more consistent codebase.
Advantages of NodeJs
- Used to build scalable web applications
- Easy to learn
- Growing community
- Helps to create highly performant applications
- Advantage of caching
Disadvantages of NodeJs
- Library support system is not strong
- API is not stable

When to use NodeJs?
NodeJS should be used to create:
- Application based on JSON APIs
- Data streaming applications
- Real time chat applications
Creating the NodeJs server
For creating the NodeJs server, first we need to install it using the given command:
sudo apt install nodejs
Create a file named app.js containing the following contents:

Now run the server using
node app.js.
Visit http://localhost:3000
and you will see a message saying ” Hello Node from Node! “
Conclusion
Node.js is very useful for building scalable and high-performing online applications. It has also broadened the scope of JavaScript applications, making it suitable for both frontend and backend servers.
Thank you for reading, if you really like the blog hit the like button, and to learn more, visit here