Computer Science

Computer Science

In this section, we explore the world of programming, algorithms, networks, and infrastructure

ProgrammingAlgorithmsComputer NetworksTechnologyInfrastructureSoftware EngineeringHardware Engineering

Related Categories

Featured Articles

Global Objects in Node.js: Built-in Globals and Utilities

Node.js provides a set of global objects and variables that are accessible across all modules. Some variables, such as __dirname and __filename, appear global but are only valid within the scope of CommonJS modules. In addition, Node.js includes classes and utilities like AbortController, Buffer, BroadcastChannel, fetch, and localStorage, which combine Node.js-specific features with browser-compatible APIs.

/article/global-objects-in-nodejs-built-in-globals-and-utilities

HTTP Module in Node.js: Low-Level Client and Server

The http module in Node.js implements both HTTP client and server functionality. It is designed to handle streaming data and message parsing without buffering entire requests or responses, making it suitable for large or chunk-encoded messages. The API is intentionally low-level, focusing on stream management and message parsing rather than interpreting headers or body content.

/article/http-module-in-nodejs-low-level-client-and-server

HTTP/2 in Node.js: Core API, Sessions, and Streams

The node:http2 module provides a stable implementation of the HTTP/2 protocol in Node.js. . Unlike the HTTP/1 API, the HTTP/2 Core API is designed specifically for protocol features such as multiplexed streams, server push, and advanced flow control. It offers a symmetric design between client and server, with events like stream, error, and connect available on both sides. Developers can use secure servers (http2.createSecureServer) for browser compatibility, and clients can connect using http2.connect.

/article/http2-in-nodejs-core-api-sessions-and-streams

HTTPS in Node.js: Secure Servers and Encrypted Requests

The node:https module implements the HTTP protocol over TLS/SSL in Node.js. . It enables developers to create secure servers, manage encrypted connections, and send HTTPS requests. By using TLS certificates, developers can establish secure communication channels, leverage agents for connection management, and ensure client requests are transmitted securely.

/article/https-in-nodejs-secure-servers-and-encrypted-requests

Inspector in Node.js: Debugging and Profiling with the DevTools Protocol

The node:inspector module provides an API for interacting with the V8 Inspector. It allows developers to connect to the Chrome DevTools Protocol, enabling debugging, CPU profiling, heap profiling, and network inspection. The Inspector module offers both a Promises-based API and a Callback-based API, making it flexible for different coding styles.

/article/inspector-in-nodejs-debugging-and-profiling-with-the-devtools-protocol

Internationalization Support in Node.js with ICU

Node.js provides extensive features for writing internationalized applications. These include locale-sensitive functions in ECMAScript, the Intl object, Unicode-aware string methods, internationalized domain name (IDN) support in the WHATWG URL parser, and utilities like TextDecoder, buffer.transcode(), and RegExp Unicode property escapes. These capabilities are powered by the V8 engine and the ICU (International Components for Unicode) library. Depending on how Node.js is built, ICU data can be embedded fully, partially, or disabled entirely.

/article/internationalization-support-in-nodejs-with-icu

CommonJS Modules in Node.js

CommonJS modules are the original way of packaging JavaScript code in Node.js. . Each file is treated as a separate module, and modules can be imported using require(). Exports are defined using exports or module.exports. This system allows developers to organize code, manage dependencies, and reuse functionality across applications.

/article/commonjs-modules-in-nodejs

ECMAScript Modules in Node.js

ECMAScript modules (ESM) are the official standard for packaging JavaScript code for reuse. They use import and export statements and are fully supported in Node.js, alongside interoperability with CommonJS. Node.js allows developers to explicitly mark files as ES modules using .mjs, the "type": "module" field in package.json, or the --input-type=module flag. ES modules provide modern features such as dynamic imports, import.meta properties, and support for JSON and WASM imports.

/article/ecmascript-modules-in-nodejs

The node:module API in Node.js

The node:module API provides general utility methods for interacting with Node.js modules. It allows developers to inspect built-in modules, create require functions inside ES modules, locate package.json files, register custom hooks to modify module resolution and loading behavior, synchronize CommonJS and ESM exports, and enable compile caching to improve performance.

/article/the-nodemodule-api-in-nodejs

Packages in Node.js

A package in Node.js is a folder tree described by a package.json file. The package consists of the folder containing the package.json file and all subfolders until another folder with its own package.json or a node_modules folder is encountered. The package.json file defines how .js files are interpreted (as CommonJS or ES modules), specifies entry points, and controls exports and imports. Node.js supports both CommonJS and ES modules, and package authors can use fields like type, main, exports, and imports to configure behavior.

/article/packages-in-nodejs

TypeScript Support in Node.js

Node.js provides two ways to run TypeScript files: full support via third-party packages, or lightweight built-in support through type stripping. Full support allows all TypeScript features (including tsconfig.json) using tools like tsx. Type stripping, on the other hand, removes inline types without type checking or complex transformations, enabling quick execution of .ts files. Node.js supports both CommonJS and ES modules in TypeScript, with module system determined by file extensions and package.json settings.

/article/typescript-support-in-nodejs

The Net Module in Node.js

The node:net module provides an asynchronous networking API for creating stream-based TCP or IPC servers and clients. It supports inter-process communication (IPC) with named pipes on Windows and Unix domain sockets on other operating systems. With classes like net.Server, net.SocketAddress, and net.BlockList, developers can build servers, manage connections, and control access to IP addresses.

/article/the-net-module-in-nodejs
Computer Science | Dr. Shahin Siami