Index - Node documentation

assert

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

async_hooks

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

buffer

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

child_process

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:

cluster

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.

console

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

crypto

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

dgram

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

diagnostics_channel

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

dns

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

dns/promises

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').

domain

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.

events

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.

fs

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

fs/promises

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

http

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

http2

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

https

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

inspector

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

net

Stability: 2 - Stable

os

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

path

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

perf_hooks

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.

punycode

**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.

querystring

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

readline

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

repl

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:

sea

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

stream

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.

string_decoder

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:

test/reporters

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

timers

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.

timers/promises

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

tls

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:

trace_events

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

tty

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:

url

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

util

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:

v8

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:

vm

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

wasi

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.

worker_threads

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

zlib

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