🚀 What I Learned Today: Node.js Internals • Node.js runs JavaScript on a single main thread • Top-level code executes first before the event loop starts • Import statements load during initialization • Event Loop manages asynchronous operations Event Loop Phases: • Timers → setTimeout() / setInterval() • I/O Polling → file system & network operations • Check → setImmediate() (Node.js specific) • Close Callbacks → cleanup tasks • Node.js uses a libuv worker thread pool (default: 4 threads) • Thread pool size can be changed using process.env.UV_THREADPOOL_SIZE https://lnkd.in/gwFG5WVW thank you Piyush Garg sir Hitesh Choudhary sir Akash Kadlag sir #chaiaurcode #NodeJS #JavaScript #Backend #EventLoop
Node.js Internals: Event Loop Phases Explained
More Relevant Posts
-
Today Class was on Internals of Node.js! Understood how Node.js runs on a single main thread, uses the event loop to handle async tasks, and a thread pool (default 4 threads) for heavy operations. Also learned how phases like I/O polling, expired callbacks, and setImmediate work behind the scenes. Really interesting to see how Node.js executes code internally. #NodeJS #NodeJSInternals #JavaScript #EventLoop #ChaiCohort26 #Chaicode Hitesh Choudhary Chai Code #piyushgarg Anirudh Jwala Akash Kadlag Jay Kadlag JavaScript
To view or add a comment, sign in
-
-
Day 2 🚀 It’s working. From idea → to a working CLI that sets up my full stack in one command ⚡ What it does: • Creates frontend/ (Next.js) • Creates backend/ (Express + MongoDB ready) • Sets up basic structure + routes Run once → start coding instantly. Next step: Publishing it as an npm package 📦 Turning a repetitive problem into a real tool feels 🔥 Would you use something like this? #BuildInPublic #JavaScript #NextJS #NodeJS #CLI
To view or add a comment, sign in
-
I still remember the old npm ritual: install a package → hit type errors → hunt down @types/* → repeat 😄 If you’re returning to JS/TS after some time, you’ll notice a big change… 👉 You don’t need @types as much anymore. So what changed? Over the last few years, the ecosystem quietly evolved: • Most modern libraries now ship with built-in TypeScript types • TypeScript is no longer “optional” — it’s the default • Tooling (Vite, tsup, etc.) makes generating types effortless • Newer runtimes are becoming more TS-friendly In short: 📦 Libraries now come “type-ready” out of the box You’ll still see @types/* for: – Older JS libraries – Node/test environments – Some community-maintained packages But the constant back-and-forth? Mostly gone. #TypeScript #JavaScript #WebDevelopment #NodeJS #DeveloperExperience #CodingLife #SoftwareEngineering
To view or add a comment, sign in
-
🚨 JavaScript Tricky Question #3 (Advanced) What will be the output? 🤯 Promise.resolve() .then(() => { console.log("A"); throw new Error("Error!"); }) .catch(() => { console.log("B"); }) .then(() => { console.log("C"); }); Think carefully (this is tricky) 💬 Comment your answer 👇 🔁 Follow for daily advanced JS questions #javascriptdeveloper #mernstackdeveloper #frontendinterview #javascriptquestions #webdevelopmenttips #learnjavascript #jsconcepts #asyncjavascript #developersindia #codinginterview #softwaredeveloperlife #nodejsdeveloper #reactdeveloper #techcareers
To view or add a comment, sign in
-
Explored Node.js Internals in today’s class ⚡ Process Start → Main Thread → Run Code → Register Callbacks → Start Event Loop. Event Loop handles: Timers → I/O → setImmediate → Close Callbacks. Thanks to Piyush Garg sir for the great explanation 🙌 Chai Code #NodeJS #JavaScript #Backend
To view or add a comment, sign in
-
-
Ever wondered how Node.js works behind the scenes? 🤔 In my latest blog, I broke down Node.js internals in a simple way — focusing on the 3 core components: 🔹 V8 Engine (executes JS & manages memory) 🔹 Libuv (handles async tasks & event loop) 🔹 Bindings (connects V8 with system-level operations) Understanding this flow really changes how you look at things like fs.readFile() or setTimeout() 💡 👉 Read the full blog here: https://lnkd.in/g-AbBCiy I’d really appreciate your thoughts, feedback, or any experiences you’ve had while working with event propagation 😊 Hitesh Choudhary | Piyush Garg | Akash Kadlag #JavaScript #WebDevelopment #Blog #NodeJs #Cohort2026 #LearnInPublic #libuv #v8
To view or add a comment, sign in
-
By @addaleax MongoDB When server-side JavaScript crashes, the problem may lie beyond JS. This talk shows how native debuggers and tracing tools help investigate memory leaks and crashes across the boundary between JavaScript and C/C++. tickets available: https://lnkd.in/eR2QazBH #javascript #nodejs #debugging #perfomance
To view or add a comment, sign in
-
-
Being a backend developer means writing small pieces of logic while relying on a massive ecosystem of packages. That’s the power (and weight) of modern JavaScript. #BackendDeveloper #NodeJS #SoftwareEngineering
To view or add a comment, sign in
-
-
🚀 I Finally Understood the Node.js Event Loop And it made Node.js make so much more sense. Most developers use Node.js daily. But very few understand what happens behind the scenes. Here are 3 things I learned today 👇 🔹 1. Node.js Uses libuv libuv powers the event loop and handles async tasks like: • File operations • Network requests • Timers This is why Node.js is non-blocking and scalable. 🔹 2. Before the Event Loop Starts Node.js first: • Initializes the environment • Executes top-level code • Loads modules (require / import) • Registers callbacks Only then does the event loop begin. 🔹 3. Event Loop Phases Once running, Node.js processes tasks in phases: 1️⃣ Timers 2️⃣ I/O callbacks 3️⃣ Polling 4️⃣ setImmediate 5️⃣ Close callbacks Understanding this helps write better async code. Big thanks to Hitesh Choudhary, Piyush Garg, Jay Kadlag for the amazing explanation. #NodeJS #JavaScript #BackendDevelopment #WebDevelopment
To view or add a comment, sign in
-
-
🚀 Understanding Node.js Internals: Event Loop & Thread Pool This week, I took a deeper dive into how Node.js actually works behind the scenes — and it completely changed how I think about asynchronous code. 🔹 JavaScript in Node.js runs on a single thread 🔹 Yet it handles multiple tasks efficiently using the Event Loop 🔹 Heavy operations are offloaded to the Thread Pool (via libuv) Some key takeaways: Event Loop manages execution in phases (Timers, I/O, setImmediate, etc.) setTimeout(0) is not truly immediate setImmediate() behaves differently inside vs outside I/O process.nextTick() runs before the event loop even starts Understanding these concepts makes async behavior much more predictable and helps write better backend code. Would love to hear your thoughts or corrections 🙌! Blog Link : https://lnkd.in/gxBA4DeT #JavaScript #WebDev #LearnInPublic #Blog #libuv #EventLoop #ThreadPool #ChaiCode Thanks to Hitesh Choudhary, Piyush Garg, Jay Kadlag, Akash Kadlag for guidance 😊
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development