DEV Community

Cover image for Introduction to Node.js
Devjeet Roy
Devjeet Roy

Posted on

Introduction to Node.js

Introduction:

As per the Node.js official documentation, Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Before you mess up with the terms used here, let me explain what the official definition actually means by breaking it into small parts. When we run a JavaScript code or work with any JavaScript frameworks, the code gets executed in the browser. So, in that case our browser is the JavaScript runtime. The JavaScript(JS) code is converted into machine code with the help of a JavaScript parser. In case of Google Chrome, it's V8, for Firefox it's SpiderMonkey and for Microsoft Edge it's Chakra. There are couples of libraries on which Node.js depends to work properly.
Most important are: Chrome's V8 & LIBUV.
If V8 was not there then Node.js had no way to understand, the JS code we write in the Node.js environment. LIBUV is an opensource library with strong focus on asynchronous I/O. this gives access to OS, file system, networking and more. This is also responsible for 2 main features of Node.

  1. The Event Loop.
  2. The Thread Pool. Apart from all of this, Node.js also depends on:
  3. http-parser for parsing http.
  4. c-ares for some DNS request staff.
  5. OpenSSL for cryptography.
  6. zlib for compression. We will discuss all of the above points in the upcoming posts. But let us first focus on the primary idea. In simple words, Node.js lets developers use JavaScript to write command line tools and for server-side scripting-running scripts server-side to produce dynamic web page content before the page is sent to the user's web browser.

Characteristics of Node.js:

  1. Fast, efficient and highly scalable.
  2. Event driven, non-blocking I/O Model.
  3. Asynchronous in nature.
  4. Single Threaded.
  5. It's Open Source.
  6. We use only one language at both ends of the website. To read more visit : https://learnnodeonline.blogspot.com/

Top comments (0)