How Node - Js Works
How Node - Js Works
@codewithanjum
01
HOW
NODE.JS
WORKS
Follow On IG Subscribe On YT
@codewithanjum @codewithanjum
CodeWithAnjum
@codewithanjum
02
Follow On IG Subscribe On YT
@codewithanjum @codewithanjum
CodeWithAnjum
@codewithanjum
03
V8 Engine:
Node.js uses the V8 engine to interpret and
execute JavaScript code.
V8 compiles JavaScript code into machine code,
optimizing its performance.
Follow On IG Subscribe On YT
@codewithanjum @codewithanjum
CodeWithAnjum
@codewithanjum
04
Non-Blocking I/O:
One of the key features of Node.js is its
non-blocking I/O model. When Node.js performs
an I/O operation (e.g., reading from a file,
making an HTTP request, or querying a database),
it doesn't block the execution of other code.
Instead, it registers a callback function and
continues processing other tasks. Once the I/O
operation is complete, the callback is triggered,
and the result is handled.
Follow On IG Subscribe On YT
@codewithanjum @codewithanjum
CodeWithAnjum
@codewithanjum
05
Event-Driven Architecture:
Node.js relies heavily on events and callbacks.
Events are emitted when certain actions occur,
and callback functions are registered to handle
these events.
Follow On IG Subscribe On YT
@codewithanjum @codewithanjum
CodeWithAnjum
@codewithanjum
06
Modules:
Node.js follows the CommonJS module system. It
allows developers to organize their code into
reusable modules, each encapsulating specific
functionality. Modules can be imported into other
modules using the require() function.
Follow On IG Subscribe On YT
@codewithanjum @codewithanjum
CodeWithAnjum
@codewithanjum
07
Built-in Modules:
Node.js comes with a set of built-in modules
that provide core functionality, such as fs for file
system operations, http for creating HTTP servers,
path for handling file paths, and more.
Libuv:
Node.js uses the Libuv library to handle
asynchronous I/O operations and abstract the
underlying operating system's I/O capabilities.
Follow On IG Subscribe On YT
@codewithanjum @codewithanjum
CodeWithAnjum
@codewithanjum
08
Scalability:
Node.js is known for its ability to handle a large
number of concurrent connections efficiently due
to its non-blocking, event-driven nature.
Follow On IG Subscribe On YT
@codewithanjum @codewithanjum
CodeWithAnjum
09
@codewithanjum
Follow On IG Subscribe On YT
@codewithanjum @codewithanjum