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

مقالات

The Assert Module in Node.js: A Complete Guide

The node:assert module provides a set of assertion functions for verifying invariants in Node.js applications. It supports both strict and legacy modes, throwing an AssertionError when conditions fail. The module also includes the AssertionError and Assert classes, which allow for advanced customization and independent assertion instances.

/persian/article-fa/the-assert-module-in-nodejs-a-complete-guide

Asynchronous Context Tracking in Node.js

The node:async_hooks module provides tools for tracking and managing asynchronous contexts in Node.js. . Its two main classes, AsyncLocalStorage and AsyncResource, allow developers to store and propagate state across callbacks and promise chains. This functionality is similar to thread-local storage in other languages and is essential for managing state across the lifecycle of asynchronous operations such as web requests.

/persian/article-fa/asynchronous-context-tracking-in-nodejs

Async Hooks in Node.js: A Complete Guide

The node:async_hooks module provides an API to track asynchronous resources in Node.js. . However, this API is experimental and its use is strongly discouraged due to usability issues, safety risks, and performance implications. For most use cases, AsyncLocalStorage or Diagnostics Channel are recommended alternatives. Still, understanding Async Hooks is useful for learning how asynchronous resources are created, executed, and destroyed.

/persian/article-fa/async-hooks-in-nodejs-a-complete-guide

Buffer in Node.js: A Complete Guide

The Buffer class in Node.js represents a fixed-length sequence of bytes. Many Node.js APIs support Buffers for handling raw binary data such as files, streams, and network protocols. Buffers are subclasses of Uint8Array and extend it with additional methods. They are essential for efficient binary data manipulation in Node.js applications.

/persian/article-fa/buffer-in-nodejs-a-complete-guide

Buffer in Node.js: Writing Data Methods

The Buffer class in Node.js provides a wide range of methods for writing data into binary memory. These methods cover signed and unsigned integers, floating-point numbers, big integers (bigint), and strings. They support both big-endian and little-endian formats, making them essential for binary file handling, network protocols, and low-level data operations.

/persian/article-fa/buffer-nodejs

Node-API in Node.js: A Complete Guide to Native Addon Development

Node-API (formerly N-API) is a stable API for building native Addons in Node.js. . It is independent of the underlying JavaScript engine (such as V8) and maintained as part of Node.js itself. Its primary goal is to guarantee ABI stability, ensuring that modules compiled for one major version of Node.js can run on later versions without recompilation. This makes Addon development more reliable and future-proof.

/persian/article-fa/node-api-in-nodejs-a-complete-guide-to-native-addon-development

Node.js C++ Embedder API: Running JavaScript from C++ Applications

Node.js provides a set of C++ APIs that allow developers to execute JavaScript inside a Node.js environment from C++ applications. This is useful when Node.js is embedded as a library within other software. Unlike typical Node.js code execution, embedding Node.js

/persian/article-fa/nodejs-c-embedder-api-running-javascript-from-c-applications

Node.js Child Process API: Executing Subprocesses

The node:child_process module in Node.js provides the ability to spawn subprocesses, similar to popen(3) in Unix systems but not identical. The most important function is child_process.spawn(), which creates a child process asynchronously without blocking the event loop. Other functions such as exec, execFile, fork, and their synchronous counterparts (execSync, execFileSync) offer different ways to run commands or scripts depending on the use case.

/persian/article-fa/nodejs-child-process-api-executing-subprocesses

Node.js Cluster Module: Scaling Applications with Workers

The Cluster module in Node.js enables running multiple Node.js processes that share server ports and distribute workloads across CPU cores. This is especially useful for scaling applications on multi-core systems. Each worker is an independent process, while the primary process manages workers and distributes incoming connections.

/persian/article-fa/nodejs-cluster-module-scaling-applications-with-workers

Node.js Command-line API: Options and Permissions

Node.js provides a rich set of command-line options that allow developers to configure runtime behavior, enable debugging, manage permissions, and control how scripts are executed. These options are critical for secure and flexible application deployment.

/persian/article-fa/nodejs-command-line-api-options-and-permissions

Node.js Crypto Module: Certificates, Encryption, and Key Exchange

The node:crypto module in Node.js provides cryptographic functionality including hashing, HMAC, encryption/decryption, signing, and verifying. It acts as a wrapper around OpenSSL and offers classes such as Certificate, Cipheriv, Decipheriv, and DiffieHellman for secure data handling and key exchange.

/persian/article-fa/nodejs-crypto-module-certificates-encryption-and-key-exchange

Debugger in Node.js: Command-Line Debugging Utility

Node.js includes a simple command-line debugger that allows stepping through code, inspecting variables, setting breakpoints, and evaluating expressions. While it is not a full-featured debugger, it provides essential functionality for quick debugging. For advanced usage, Node.js integrates with the V8 Inspector, enabling Chrome DevTools for profiling and step-by-step debugging.

/persian/article-fa/debugger-in-nodejs-command-line-debugging-utility
Node Js | دکتر شاهین صیامی