Main features of Node.js Flashcards

1
Q

What are the 7 main features of Node.js?

A
  1. Single threaded
  2. Asynchronous
  3. Event-Driven
  4. V8 JavaScript Engine
  5. Cross-Platform
  6. NPM (Node Package Manager)
  7. Real-Time capabilities
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an Event?

A

An event is like a signal, something has happened in the program, like a notification or an action took place.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an Event Emitter?

A

The source from which an event (signal) has originated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the Event Queue?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the Event Loop?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the main features & advantages of Node.js?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When to use Node.js?

A

Real-time applications: chat, gaming, collaborative tools.

Lightweight and scalable RESTful APIs

Systems based on microservices architecture, enabling the construction of modularity and scalability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When not to use Node.js?

A

Any applications that involve CPU intensive tasks, such as image/video processing, data encryption/decryption, etc. Any application that relies on multithreading.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly