DEV Community

Ashutosh Sarangi
Ashutosh Sarangi

Posted on

4 1 1 1 1

Node Under the hood

Introduction:
As we all know we use Node.js mostly for Servers for our applications, Which use javascript. but how it is connected to Network Of the Server section to get HTTP Object (information).

In this case, v8 came into the picture, We all know V8 is made out of C++, which has many features that can directly interact with the OS features.

Javascript does not, so it has to work with the c++ to control these computer features.

This combination is known as Node.js

Node.js

It is a language that does 3 things

  • Saves data and functionality (code)
  • uses that data by running functionality (code) on it.
  • has a ton of built-in labels that trigger node features that are built in C++ to use our computer's Internals

Executing Node Code:-

  • we can set up with a javascript label, a Node.js features (and so Computer internals) to wait for requests for html/css/js tweets from our users

  • How? The most powerful built-in Node feature of all: http
    (and its associated built-in label in js -also HTTP conveniently)

Using HTTP feature of Node (c++) to set up an open socket

const server = http.createServer()
server.listen(80) 
Enter fullscreen mode Exit fullscreen mode

inbound web request -> run code to send back the message

Q. if in bound message --> send back data but at what moment ?

Ans:- We need to send a callback method that auto called from the v8 / (node & C++) features.

in next article we will have a diagram and detail explanation how it open Socket and port how it has automated Objected passed as an argument to the function.

Link to detail Discussion via diagram:-

Reference:-

  1. https://frontendmasters.com/courses/servers-node-js

SurveyJS custom survey software

Simplify data collection in your JS app with a fully integrated form management platform. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more. Integrates with any backend system, giving you full control over your data and no user limits.

Learn more

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay