DEV Community

Matt Eddy
Matt Eddy

Posted on

1

What is Node.js?

Image description

Overview

This article is Part 8 of the series Working With NodeJS, a series of article to help simplify working with Node.js. In this article I will briefly cover what Node.js is and what it is not.

What is Node.js

Node.js is an open source cross-platform JavaScript runtime environment. It uses Chromes v8 engine, which is written in C++, to execute our JavaScript code in our applications on the platform of choice, as well as translate our JavaScript code into C++ code. Because chrome's v8 engine cannot interact with the filesystem or operating system, v8 must translate our JavaScript code so that C++ code can understand it which can interact with the filesystem and operating system. Node.js also uses the Libuv project, written in C, which provides The Event Loop. The Event Loop is like a scheduler that manages all asynchronous operations within our JavaScript program. When you start a Node.js program a single instance of The Event Loop is created and placed into a single thread. This means that our program runs on one core of the CPU. Node.js is not entirely single threaded. There are functions utilized within the Node.js library that run outside The Event Loop thus creating and using additional threads. You can manage the amount of threads available for these functions with the process.env.UV_THREADPOOL_SIZE. The default number of threads available is 4.

Resources

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

nextjs tutorial video

Youtube Tutorial Series 📺

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series 👀

Watch the Youtube series

👋 Kindness is contagious

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

Okay