These are some Node JS discussion questions to deepen your understanding of NodeJS
- Differentiate between JavaScript and Node.js.
- Why Node.js is single threaded?
- How do Node.js works?
- What is package.json?
- What is an Event loop in Node.js and how does it work?
Team : Amjad - Mohammad Sheikh - Huzefye Abdullahoglu - Hamza
Differentiate between JavaScript and Node.js.
In web development: Javascript is executed in browser (at client side), on the other hand, Node.js designed for backend applications and Apis
Node is an environment written in C, C++, and JavaScript, and it is built on the open-source V8 JavaScript engine which also powers JS in browsers such as Google Chrome. As V8 supports new features in JavaScript, they are incorporated into Node.
runs on a server, used to make
Backend For Social Media Networking
Single-Page Applications
Chat Applications
Data Streaming
IoT Applications
Why Node.js is single threaded?
Node.js is relayed on javascript, so because JS is single threaded node.js will do so
(The single-threaded, event-driven architecture makes it very easy for handling multiple connections. An additional thread is created with each new request with Most of the popular programming languages but with Node that’s not the case.)
How does Node.js work?
It work by using the v8 engine which is the same engine that javascript uses , and node js been written with c++ language so that we can run node js on our computer as a server
What is package.json?
Package.json is a file which contain all dependencies and libraries that we install using the node package manger (npm) , so that we don’t have to upload all library to the host when we finish the program
What is an Event loop in Node.js and how does it work?
An event loop is an event-listener which functions inside the NodeJS environment and is always ready to listen, process, and output for an event. An event can be anything from a mouse click to a keypress or a timeout
Event loop waits for tasks, executes them and then sleeps until it receives more tasks. it executes tasks from the event queue only when the call stack is empty.
Sourece :
https://www.tatvasoft.com/outsourcing/2021/09/what-can-we-do-with-node-js.html