Please enable JavaScript.
Coggle requires JavaScript to display documents.
Node.js - Coggle Diagram
Node.js
Fundamentals
Server side web app
Everything is asynchronous
all modules
Cross platform
Event Loop process model
handles all the asynchronous callbacks in an application
reason behind Node.js have non-blocking I/O
How it works?
single-threaded event loop
non-blocking I/O
Single thread/core -> run on multiples threads
event-driven language
Event Queue
all the callback functions are placed in a queue
Runtime Environment
Callback
Virtual machine
Runs on a v8 environment
Control flow function
code that is executed between the asynchronous function calls
NPM
Package Manager
contains many JS libs (including React)
Package.json
project metadata
dependencies
modules
Event-driven programming
Event Selection
Event Handling
the flow of the program is determined by events like messages from other programs or thread
Use Cases
Data intensive applications
Not Ideal for computation intensive tasks
Real time
Middleware
receives the Request and Response objects
performed tasks
Execute any type of code
Update or modify the request and the response objects
Finish the request-response cycle
function