Node Js

Node Js

Node.js is an open-source runtime environment that allows developers to execute JavaScript code outside the browser, typically on the server side. It utilizes an event-driven, non-blocking I/O architecture, making it highly efficient for building fast and scalable network applications. This platform is ideal for creating web servers, APIs, and real-time applications where managing many concurrent connections is critical.

Node js

Articles

Deprecated APIs in Node.js: Reasons, Types, and Examples

In Node.js, certain APIs are deprecated for reasons such as being unsafe, having better alternatives, or planned breaking changes in future releases. Deprecations are categorized into four types:

/article/deprecated-apis-in-nodejs-reasons-types-and-examples

Diagnostics Channel in Node.js: Managing Diagnostic Messages and Tracing

The node:diagnostics_channel module provides an API for creating named channels to publish diagnostic messages. These channels allow developers to trace application flow, monitor events, and share structured diagnostic data across modules. With support for synchronous and asynchronous tracing, as well as integration with AsyncLocalStorage, Diagnostics Channel is a powerful tool for observability in Node.js applications.

/article/diagnostics-channel-in-nodejs-managing-diagnostic-messages-and-tracing

DNS Module in Node.js: Name Resolution and Networking

The node:dns module provides name resolution capabilities in Node.js. . It allows developers to look up IP addresses for hostnames and perform DNS queries. While dns.lookup() uses the operating system’s facilities (and may not involve actual DNS protocol communication), other functions such as dns.resolve4() or dns.reverse() directly query DNS servers. The module also provides the dns.Resolver class for creating independent resolvers with custom server configurations.

/article/dns-module-in-nodejs-name-resolution-and-networking

Domain Module in Node.js: Error and Event Management

The node:domain module provides a way to handle multiple I/O operations as a single group, routing errors and uncaught exceptions to a domain object instead of crashing the process. However, this module is deprecated and should not be used in new applications. Developers who rely on it must plan to migrate to safer alternatives such as async_hooks or structured error handling.

/article/domain-module-in-nodejs-error-and-event-management

Environment Variables in Node.js

Environment variables are values associated with the environment in which a Node.js process runs. They can be used to configure application behavior, manage secrets, and define runtime options. Node.js provides built-in APIs for interacting with environment variables, and .env files are commonly used to manage them in a structured way.

/article/environment-variables-in-nodejs

مدیریت خطاها در Node.js

برنامه‌های نوشته‌شده با Node.js در طول اجرا با انواع مختلف خطاها مواجه می‌شوند؛ از خطاهای استاندارد جاوااسکریپت گرفته تا خطاهای سیستم‌عامل و خطاهای تعریف‌شده توسط کاربر. Node.js مکانیزم‌های مختلفی برای انتشار و مدیریت این خطاها ارائه می‌دهد. شناخت این مکانیزم‌ها برای نوشتن برنامه‌های پایدار و مقاوم ضروری است.

/article/error-handling-in-nodejs-fa

Events Module in Node.js: Event-Driven Architecture

Much of the Node.js core API is built around an asynchronous, event-driven architecture. In this model, certain objects called emitters generate named events, and functions called listeners respond to those events. This design makes it easier to handle I/O operations, streams, and asynchronous workflows in a clean and efficient way.

/article/events-module-in-nodejs-event-driven-architecture

File System Module in Node.js: Managing Files and Streams

The node:fs module allows interaction with the file system using APIs modeled on standard POSIX functions. Node.js provides three forms of file system operations: Promise-based, Callback-based, and Synchronous. Each form has its own use cases depending on performance needs and application design

/article/file-system-module-in-nodejs-managing-files-and-streams

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