Main features of Node.js Flashcards
What are the 7 main features of Node.js?
- Single threaded
- Asynchronous
- Event-Driven
- V8 JavaScript Engine
- Cross-Platform
- NPM (Node Package Manager)
- Real-Time capabilities
What is an Event?
An event is like a signal, something has happened in the program, like a notification or an action took place.
What is an Event Emitter?
The source from which an event (signal) has originated.
What is the Event Queue?
All events generated from an Event Emitter get stored in a Queue, the Event Queue. This is an simply a data structure that helps manage these events.
What is the Event Loop?
Is a part of the Node.js runtime, it’s a loop responsible for managing the execution of the events stored in the event queue and microtask queue. The order is always FIFO, prioritizing the microtask queue.
What are the main features & advantages of Node.js?
Features: Asynchronous, V8 JS Engine, Event-Driven Architecture, Cross-Platform, JavaScript
Advantages: enables multiple concurrent requests & non-blocking execution of tasks, Node.js Executes code fast using the Chrome V8 engine, efficient handling of events (great of real time applications where bidirectional communication is required), deploy the app in any OS, already in JavaScript, so there’s no need to learn a new language. Node is suitable for building scalable applications.
When to use Node.js?
Real-time applications: chat, gaming, collaborative tools.
Lightweight and scalable RESTful APIs
Systems based on microservices architecture, enabling the construction of modularity and scalability.
When not to use Node.js?
Any applications that involve CPU intensive tasks, such as image/video processing, data encryption/decryption, etc. Any application that relies on multithreading.