Index - Node documentation


The node:assert module provides a set of assertion functions for verifying invariants.


We strongly discourage the use of the async_hooks API. Other APIs that can cover most of its use cases include:


Buffer objects are used to represent a fixed-length sequence of bytes. Many Node.js APIs support Buffers.


The node:child_process module provides the ability to spawn subprocesses in a manner that is similar, but not identical, to popen(3). This capability is primarily provided by the spawn function:


Clusters of Node.js processes can be used to run multiple instances of Node.js that can distribute workloads among their application threads. When process isolation is not needed, use the worker_threads module instead, which allows running multiple application threads within a single Node.js instance.


The node:console module provides a simple debugging console that is similar to the JavaScript console mechanism provided by web browsers.


The node:crypto module provides cryptographic functionality that includes a set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions.


The node:dgram module provides an implementation of UDP datagram sockets.


The node:diagnostics_channel module provides an API to create named channels to report arbitrary message data for diagnostics purposes.


The node:dns module enables name resolution. For example, use it to look up IP addresses of host names.


The dns.promises API provides an alternative set of asynchronous DNS methods that return Promise objects rather than using callbacks. The API is accessible via require('node:dns').promises or require('node:dns/promises').


This module is pending deprecation. Once a replacement API has been finalized, this module will be fully deprecated. Most developers should not have cause to use this module. Users who absolutely must have the functionality that domains provide may rely on it for the time being but should expect to have to migrate to a different solution in the future.


Much of the Node.js core API is built around an idiomatic asynchronous event-driven architecture in which certain kinds of objects (called "emitters") emit named events that cause Function objects ("listeners") to be called.


The node:fs module enables interacting with the file system in a way modeled on standard POSIX functions.


The fs/promises API provides asynchronous file system methods that return promises.


To use the HTTP server and client one must require('node:http').


The node:http2 module provides an implementation of the HTTP/2 protocol. It can be accessed using:


HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a separate module.


The node:inspector module provides an API for interacting with the V8 inspector.


Stability: 2 - Stable


The node:os module provides operating system-related utility methods and properties. It can be accessed using:


The node:path module provides utilities for working with file and directory paths. It can be accessed using:


This module provides an implementation of a subset of the W3C Web Performance APIs as well as additional APIs for Node.js-specific performance measurements.


**The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users currently depending on the punycode module should switch to using the userland-provided Punycode.js module instead. For punycode-based URL encoding, see url.domainToASCII or, more generally, the WHATWG URL API.


The node:querystring module provides utilities for parsing and formatting URL query strings. It can be accessed using:


The node:readline module provides an interface for reading data from a Readable stream (such as process.stdin) one line at a time.


The node:repl module provides a Read-Eval-Print-Loop (REPL) implementation that is available both as a standalone program or includible in other applications. It can be accessed using:


This feature allows the distribution of a Node.js application conveniently to a system that does not have Node.js installed.


A stream is an abstract interface for working with streaming data in Node.js. The node:stream module provides an API for implementing the stream interface.


The node:string_decoder module provides an API for decoding Buffer objects into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 characters. It can be accessed using:


The node:test/reporters module exposes the builtin-reporters for node:test. To access it:


The timer module exposes a global API for scheduling functions to be called at some future period of time. Because the timer functions are globals, there is no need to call require('node:timers') to use the API.


The timers/promises API provides an alternative set of timer functions that return Promise objects. The API is accessible viarequire('node:timers/promises').


The node:tls module provides an implementation of the Transport Layer Security (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. The module can be accessed using:


The node:trace_events module provides a mechanism to centralize tracing information generated by V8, Node.js core, and userspace code.


The node:tty module provides the tty.ReadStream and tty.WriteStreamclasses. In most cases, it will not be necessary or possible to use this module directly. However, it can be accessed using:


The node:url module provides utilities for URL resolution and parsing. It can be accessed using:


The node:util module supports the needs of Node.js internal APIs. Many of the utilities are useful for application and module developers as well. To access it:


The node:v8 module exposes APIs that are specific to the version of V8 built into the Node.js binary. It can be accessed using:


The node:vm module enables compiling and running code within V8 Virtual Machine contexts.


The node:wasi module does not currently provide the comprehensive file system security properties provided by some WASI runtimes. Full support for secure file system sandboxing may or may not be implemented in future. In the mean time, do not rely on it to run untrusted code.


The node:worker_threads module enables the use of threads that execute JavaScript in parallel. To access it:


The node:zlib module provides compression functionality implemented using Gzip, Deflate/Inflate, and Brotli.